Add initial implementation of grants
This commit is contained in:
parent
b8f1281f78
commit
69b6579de7
15 changed files with 308 additions and 73 deletions
15
internal/models/grant.go
Normal file
15
internal/models/grant.go
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue