summaryrefslogtreecommitdiffstats
path: root/lib/roles.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/roles.lua')
-rw-r--r--lib/roles.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/roles.lua b/lib/roles.lua
index e6e6515..b828458 100644
--- a/lib/roles.lua
+++ b/lib/roles.lua
@@ -89,7 +89,7 @@ list_default_roles = function(self)
local rolesfiles = get_roles_candidates(self.conf.appdir)
for x,file in ipairs(rolesfiles) do
- f = fs.read_file_as_array(file)
+ f = fs.read_file_as_array(file) or {}
for y,line in pairs(f) do
if not reverseroles[string.match(line,"^[%w_]+")] then
default_roles[#default_roles+1] = string.match(line,"^[%w_]+")
@@ -139,7 +139,7 @@ get_roles_perm = function(self,roles)
local rolesfiles = get_roles_candidates(self.conf.appdir)
for x,file in ipairs(rolesfiles) do
- f = fs.read_file_as_array(file)
+ f = fs.read_file_as_array(file) or {}
for y,line in pairs(f) do
if reverseroles[string.match(line,"^[%w_]+")] then
temp = format.string_to_table(string.match(line,"[,%w_:]+$"),",")
@@ -192,7 +192,7 @@ get_role_perm = function(self,role)
local rolesfiles = get_roles_candidates(self.conf.appdir)
for x,file in ipairs(rolesfiles) do
- f = fs.read_file_as_array(file)
+ f = fs.read_file_as_array(file) or {}
for y,line in pairs(f) do
if role == string.match(line,"^[%w_]+") then
temp = format.string_to_table(string.match(line,"[,%w_:]+$"),",")