diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-12-17 12:50:28 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-12-17 12:50:28 +0200 |
commit | 8334b598f85317eb4d44000f6ec580c54734b15d (patch) | |
tree | 04dd1b84443287aec625ab019b02fc170ae524a1 /ident/ident.c | |
parent | 8426fc4411c9679a10863d7aa3ced077155e0016 (diff) | |
download | pies-8334b598f85317eb4d44000f6ec580c54734b15d.tar.gz pies-8334b598f85317eb4d44000f6ec580c54734b15d.tar.bz2 |
Implement user privileges
* src/pies.h (component): New members: list_acl and
adm_acl.
(control): Removed id_acl.
New members: adm_acl and usr_acl.
* src/pies.c (component_keywords): New keywords list-acl and
admin-acl. Removed identity-acl.
* ident/ident.c (pies_identity_user_name): New function.
* ident/identity.h (pies_identity_user_name): New proto.
* src/ctl.c (CTL_USER_STATE,CTL_ADMIN_STATE): New states.
(cmdtab): Mark administrative commands as valid in CTL_ADMIN_STATE
(ctlio_create): Assume CTL_ADMIN_STATE in the absense of identity
providers.
(auth_data): New struct.
(cmd_auth): Select appropriate state depending on the user permissions.
(list_matches): New function.
(eval_env): Keep the list of selected progs.
(count_prog): Removed.
(selector): New function.
(cmd_list): Rewrite to take into account access rights.
(cmd_start,cmd_stop)
(cmd_restart): Only allowed for users with administrative
privileges.
Diffstat (limited to 'ident/ident.c')
-rw-r--r-- | ident/ident.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ident/ident.c b/ident/ident.c index 38ae1a8..dbf3f9b 100644 --- a/ident/ident.c +++ b/ident/ident.c @@ -38,12 +38,20 @@ pies_authenticate (pies_identity_provider_t pr, pies_identity_t id, id->provider = pr; return 0; } return 1; } +char const * +pies_identity_user_name (pies_identity_t id) +{ + if (!id) + return NULL; + return id->username; +} + int pies_identity_is_user (pies_identity_t id, char * const * users) { if (!id) return 0; return is_array_member (users, id->username); |