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
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
import polkit #print polkit.auth_list_all() polkit.auth_add("tr.org.sulin.scom.net.link.set", None, 1000, None)
import polkit #print polkit.auth_list_all() polkit.auth_add("tr.org.pardus.comar.net.link.set", None, 1000, None)