generated from VLADIMIR/template
fix
This commit is contained in:
@@ -28,13 +28,16 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
type UiService struct{}
|
||||
// UIService provides user interface permissions.
|
||||
type UIService struct{}
|
||||
|
||||
func NewUiService() *UiService {
|
||||
return &UiService{}
|
||||
// NewUIService creates a UI service.
|
||||
func NewUIService() *UIService {
|
||||
return &UIService{}
|
||||
}
|
||||
|
||||
func (s *UiService) GetPermissions(roles []string) []string {
|
||||
// GetPermissions returns permissions for the supplied roles.
|
||||
func (s *UIService) GetPermissions(roles []string) []string {
|
||||
resMap := s.getPermissionsMap(roles)
|
||||
res := make([]string, 0, len(resMap))
|
||||
for permission := range resMap {
|
||||
@@ -43,7 +46,7 @@ func (s *UiService) GetPermissions(roles []string) []string {
|
||||
return res
|
||||
}
|
||||
|
||||
func (s *UiService) getPermissionsMap(roles []string) map[string]any {
|
||||
func (s *UIService) getPermissionsMap(roles []string) map[string]any {
|
||||
resMap := make(map[string]any, 100)
|
||||
|
||||
if slices.Contains(roles, rolesModule.Admin) {
|
||||
|
||||
Reference in New Issue
Block a user