|
|
package rbac
|
|
|
|
|
|
import (
|
|
|
"fmt"
|
|
|
"oppmg/common/log"
|
|
|
"oppmg/models"
|
|
|
"oppmg/protocol"
|
...
|
...
|
@@ -41,6 +42,7 @@ func GetRoleHasMenu(roleid int64, companyid int64) (*protocol.ResponseRoleMenus, |
|
|
return nil, protocol.NewErrWithMessage("1")
|
|
|
}
|
|
|
if roleData.CompanyId != companyid {
|
|
|
fmt.Println(roleData.CompanyId, companyid)
|
|
|
log.Error("角色的公司id不匹配")
|
|
|
return nil, protocol.NewErrWithMessage("1")
|
|
|
}
|
...
|
...
|
@@ -106,7 +108,7 @@ func GetRoleHasMenuAll(roleid int64, companyid int64) (map[string]PermissionCont |
|
|
}
|
|
|
|
|
|
func RoleMenuEdit(companyid int64, roleId int64, menuids []int64) error {
|
|
|
roleMenus, err := GetRoleHasMenu(companyid, roleId)
|
|
|
roleMenus, err := GetRoleHasMenu(roleId, companyid)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
...
|
...
|
|