diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-11-10 19:30:22 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-11-10 19:30:22 +0000 |
commit | 88cbca04a9057d1ee14ad1083a1095f73794620b (patch) | |
tree | ab8327ae65835d9002f0029942e0996bd2e4ecbc | |
parent | 46dcaec8888f7dfbda43852d3f1a5c94c9b1ac54 (diff) | |
download | acf-core-88cbca04a9057d1ee14ad1083a1095f73794620b.tar.bz2 acf-core-88cbca04a9057d1ee14ad1083a1095f73794620b.tar.xz |
Modified roles to allow '_' in controller names.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1586 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r-- | lib/roles.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/roles.lua b/lib/roles.lua index 85f59da..29f3bdc 100644 --- a/lib/roles.lua +++ b/lib/roles.lua @@ -142,9 +142,9 @@ get_roles_perm = function(self,roles) f = fs.read_file_as_array(file) for y,line in pairs(f) do if reverseroles[string.match(line,"^[%w_]+")] then - temp = format.string_to_table(string.match(line,"[,%a:]+$"),",") + temp = format.string_to_table(string.match(line,"[,%a_:]+$"),",") for z,perm in pairs(temp) do - local control,action = string.match(perm,"(%a+):(%a+)") + local control,action = string.match(perm,"([%a_]+):([%a_]+)") if control then if nil == permissions[control] then permissions[control] = {} @@ -165,7 +165,7 @@ get_roles_perm = function(self,roles) if reverseroles[entry.id] then temp = format.string_to_table(entry.entry, ",") for z,perm in pairs(temp) do - local control,action = string.match(perm,"(%a+):(%a+)") + local control,action = string.match(perm,"([%a_]+):([%a_]+)") if control then if nil == permissions[control] then permissions[control] = {} @@ -195,9 +195,9 @@ get_role_perm = function(self,role) f = fs.read_file_as_array(file) for y,line in pairs(f) do if role == string.match(line,"^[%w_]+") then - temp = format.string_to_table(string.match(line,"[,%a:]+$"),",") + temp = format.string_to_table(string.match(line,"[,%a_:]+$"),",") for z,perm in pairs(temp) do - local control,action = string.match(perm,"(%a+):(%a+)") + local control,action = string.match(perm,"([%a_]+):([%a_]+)") if control then if nil == permissions[control] then permissions[control] = {} @@ -218,7 +218,7 @@ get_role_perm = function(self,role) if entry then temp = format.string_to_table(entry, ",") for z,perm in pairs(temp) do - local control,action = string.match(perm,"(%a+):(%a+)") + local control,action = string.match(perm,"([%a_]+):([%a_]+)") if control then if nil == permissions[control] then permissions[control] = {} |