use user specified permission.
User settings should override default behavior.
This commit is contained in:
parent
0dfa5930b6
commit
e5b12877b9
|
@ -20,10 +20,6 @@ local default_permissions = {
|
|||
}
|
||||
|
||||
function module.check(object, class, request, context)
|
||||
if not default_permissions[class] then return true end
|
||||
if not default_permissions[class][request] then return true end
|
||||
if default_permissions[class][request][context] == nil then return true end
|
||||
|
||||
local ret = nil
|
||||
|
||||
if object._private.permissions and object._private.permissions[request] then
|
||||
|
@ -32,6 +28,10 @@ function module.check(object, class, request, context)
|
|||
|
||||
if ret ~= nil then return ret end
|
||||
|
||||
if not default_permissions[class] then return true end
|
||||
if not default_permissions[class][request] then return true end
|
||||
if default_permissions[class][request][context] == nil then return true end
|
||||
|
||||
return default_permissions[class][request][context]
|
||||
end
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("awful.permissions.client_geometry_requests", function()
|
|||
local permissions = require("awful.permissions")
|
||||
|
||||
it("removes x/y/width/height when immobilized", function()
|
||||
local c = {}
|
||||
local c = {_private={}}
|
||||
local s = stub.new(c, "geometry")
|
||||
|
||||
permissions.client_geometry_requests(c, "ewmh", {})
|
||||
|
|
Loading…
Reference in New Issue