From 23eb494b681b395f0ecbd1bafbd411c9d671779b Mon Sep 17 00:00:00 2001 From: Nathan Angelacos Date: Tue, 11 Nov 2008 18:07:55 +0000 Subject: Allow controllers to have digits in their names git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1591 ab2d0c66-481e-0410-8bed-d214d4d58bed --- lib/roles.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/roles.lua b/lib/roles.lua index 29f3bdc..5754ac1 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,"[,%w_:]+$"),",") for z,perm in pairs(temp) do - local control,action = string.match(perm,"([%a_]+):([%a_]+)") + local control,action = string.match(perm,"([%w_]+):([%w_]+)") 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,"([%w_]+):([%w_]+)") 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,"[,%w_:]+$"),",") for z,perm in pairs(temp) do - local control,action = string.match(perm,"([%a_]+):([%a_]+)") + local control,action = string.match(perm,"([%w_]+):([%w_]+)") 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,"([%w_]+):([%w_]+)") if control then if nil == permissions[control] then permissions[control] = {} -- cgit v1.2.3