X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=user_list.h;h=1cb94764cca42341e9a48b576491e12a5630d888;hp=e95747c4fb192c29136fc5e736761dd847192d58;hb=f3959d173a03f65b779885eb77fd55d3c06b8c90;hpb=63c513602a6b6a97cdced053beea0b2d07a9f984 diff --git a/user_list.h b/user_list.h index e95747c4..1cb94764 100644 --- a/user_list.h +++ b/user_list.h @@ -1,34 +1,37 @@ -/* - * Copyright (C) 2006-2009 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2006 Andre Noll , see file COPYING. */ /** \file user_list.h exported functions from user_list.c */ /** - * permission flags that can be set individually for any server command + * Flags for server commands and user permissions. * - * - AFS_READ: read-only command of the audio file selector - * - AFS_WRITE: command changes state of the audio file selector - * - VSS_READ: command reads information about the current audio stream - * - VSS_WRITE: command changes the current audio stream + * For each command, zero or more of these flags are ored to define the command + * permissions. A user is allowed to run the command if and only if all command + * permission flags are set for the user in the server.users config file which + * is read at server startup. */ -enum {AFS_READ = 1, AFS_WRITE = 2, VSS_READ = 4, VSS_WRITE = 8}; +enum server_command_permissions { + NO_PERMISSION_REQUIRED = 0, /** None of the below. */ + AFS_READ = 1, /** Read-only operation on the AFS database. */ + AFS_WRITE = 2, /** Read-write operation on the AFS database. */ + VSS_READ = 4, /** Read-only operation on the virtual streaming system. */ + VSS_WRITE = 8 /** Read-write operation on the virtual streaming system. */ +}; /** * data needed to authenticate the user */ struct user { - /** the position of this user in the list of users */ + /** The position of this user in the list of users. */ struct list_head node; - /** the username */ + /** The username. */ char *name; - /** the public RSA key */ - RSA *rsa; - /** the privileges that this user has */ + /** The public key. */ + struct asymmetric_key *pubkey; + /** The privileges of this user. */ unsigned int perms; }; -void init_user_list(char *user_list_file); -struct user *lookup_user(const char *name); +void user_list_init(const char *user_list_file); +void user_list_deplete(void); +const struct user *user_list_lookup(const char *name);