From 88cbca04a9057d1ee14ad1083a1095f73794620b Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 10 Nov 2008 19:30:22 +0000 Subject: Modified roles to allow '_' in controller names. git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1586 ab2d0c66-481e-0410-8bed-d214d4d58bed --- lib/roles.lua | 12 ++++++------ 1 file 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] = {} -- cgit v1.2.3