basicly implement acl crud ops with roles and resources
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package acl
|
||||
|
||||
type UserRole struct {
|
||||
UserID uint `gorm:"primaryKey" json:"userId"`
|
||||
RoleID uint `gorm:"primaryKey" json:"roleId"`
|
||||
UserID uint `gorm:"index;not null;uniqueIndex:ux_user_role"`
|
||||
RoleID uint `gorm:"index;not null;uniqueIndex:ux_user_role"`
|
||||
|
||||
Role Role `gorm:"constraint:OnDelete:CASCADE;foreignKey:RoleID;references:ID" json:"role"`
|
||||
//User user.User `gorm:"constraint:OnDelete:CASCADE;foreignKey:UserID;references:ID"`
|
||||
|
||||
Reference in New Issue
Block a user