Пример #1
0
def grantAuthorization(uid, action):
    uid = int(uid)
    if action == "*":
        for action_id in polkit.action_list():
            try:
                polkit.auth_revoke(uid, action_id)
                polkit.auth_add(action_id, polkit.SCOPE_ALWAYS, uid)
            except:
                return False
    else:
        try:
            polkit.auth_revoke(uid, action)
            polkit.auth_add(action, polkit.SCOPE_ALWAYS, uid)
        except:
            return False
    return True
Пример #2
0
def grantAuthorization(uid, action):
    uid = int(uid)
    try:
        polkit.auth_revoke(uid, action)
        return polkit.auth_add(action, polkit.SCOPE_ALWAYS, uid)
    except:
        return False
Пример #3
0
def grantAuthorization(uid, action):
    uid = int(uid)
    if action == "*":
        for action_id in polkit.action_list():
            try:
                polkit.auth_revoke(uid, action_id)
                polkit.auth_add(action_id, polkit.SCOPE_ALWAYS, uid)
            except:
                return False
    else:
        try:
            polkit.auth_revoke(uid, action)
            polkit.auth_add(action, polkit.SCOPE_ALWAYS, uid)
        except:
            return False
    return True
Пример #4
0
def grantAuthorization(uid, action):
    uid = int(uid)
    try:
        polkit.auth_revoke(uid, action)
        return polkit.auth_add(action, polkit.SCOPE_ALWAYS, uid)
    except:
        return False
Пример #5
0
import polkit

#print polkit.auth_list_all()
polkit.auth_add("tr.org.sulin.scom.net.link.set", None, 1000, None)
Пример #6
0
import polkit

#print polkit.auth_list_all()
polkit.auth_add("tr.org.pardus.comar.net.link.set", None, 1000, None)