Access Control: adding group field to roles (#41465)

* add group field to roles in AC models

* change to using group_name as the column name

* add a migration for group column
This commit is contained in:
Ieva
2021-11-12 10:42:47 +00:00
committed by GitHub
parent d5fc48028f
commit dcae138379
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -21,6 +21,7 @@ type Role struct {
UID string `xorm:"uid" json:"uid"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
Group string `xorm:"group_name" json:"group"`
Description string `json:"description"`
Updated time.Time `json:"updated"`
@@ -61,6 +62,7 @@ type RoleDTO struct {
Name string `json:"name"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
Group string `xorm:"group_name" json:"group"`
Permissions []Permission `json:"permissions,omitempty"`
ID int64 `json:"-" xorm:"pk autoincr 'id'"`
@@ -77,6 +79,7 @@ func (r RoleDTO) Role() Role {
UID: r.UID,
Name: r.Name,
DisplayName: r.DisplayName,
Group: r.Group,
Description: r.Description,
Updated: r.Updated,
Created: r.Created,