Fix application resource presets

This commit is contained in:
Denis Arh
2019-03-11 18:39:54 +01:00
parent 3f6035275f
commit d8c2594fa8
3 changed files with 7 additions and 5 deletions
+2 -1
View File
@@ -58,7 +58,7 @@ func (r *resources) Check(resource string, operation string, fallbacks ...CheckA
if len(parts) > 1 {
// If this is a non-service resource (so, not system, messaging),
// add checks for any-resouce (ending with `*`)
// add checks for any-resource (ending with `*`)
parts[len(parts)-1] = "*"
anyResource := strings.Join(parts, delimiter)
@@ -127,6 +127,7 @@ func (r *resources) checkAccessEveryone(resource string, operation string) Acces
if len(result) > 0 {
return result[0]
}
return Inherit
}
File diff suppressed because one or more lines are too long
@@ -33,8 +33,9 @@ REPLACE INTO `sys_application` (`id`, `name`, `enabled`, `rel_owner`, `unify`) V
-- Allow admin access to applications
INSERT INTO `sys_rules` (`rel_role`, `resource`, `operation`, `value`) VALUES
(1, 'system:application:*', 'read', 2),
(2, 'system', 'application.create', 2),
(2, 'application:role:*', 'read', 2),
(2, 'application:role:*', 'update', 2),
(2, 'application:role:*', 'delete', 2)
(2, 'system:application:*', 'read', 2),
(2, 'system:application:*', 'update', 2),
(2, 'system:application:*', 'delete', 2)
;