Add initial implementation of grants

This commit is contained in:
Tom Wiesing 2023-01-02 15:12:06 +01:00
parent b8f1281f78
commit 69b6579de7
No known key found for this signature in database
15 changed files with 308 additions and 73 deletions

15
internal/models/grant.go Normal file
View file

@ -0,0 +1,15 @@
package models
// GrantTable is the name of the table the 'Grant' model is stored in.
const GrantTable = "grant"
// Grant represents an access grant to a specific user
type Grant struct {
Pk uint `gorm:"column:pk;primaryKey"`
User string `gorm:"column:user;not null;uniqueIndex:user_slug"` // (distillery) username
Slug string `gorm:"column:slug;not null;uniqueIndex:user_slug"` // (distillery) instance slug
DrupalUsername string `gorm:"column:drupal_user;not null"` // drupal username
DrupalAdminRole bool `gorm:"column:admin;not null"` // drupal admin rights
}