# This file is part of the standard ruleset from Gitano # Copyright 2012-2017 Daniel Silverstone # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the name of the author nor the names of their contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # A useful set of defines # User/group related define is_admin group exact gitano-admin define is_owner config/project/owner exact ${user} define repo_is_personal repository prefix personal/${user}/ define if_asanother as_user pattern . # Self-related operations define op_whoami operation exact whoami define op_sshkey operation exact sshkey define op_passwd operation exact passwd define op_self anyof op_whoami op_sshkey op_passwd # Admin-related operations ## Users define op_useradd operation exact useradd define op_userdel operation exact userdel define op_userlist operation exact userlist define op_useremail operation exact useremail define op_username operation exact username define op_userrename operation exact userrename define op_user anyof op_userlist op_useradd op_userdel op_useremail op_username op_userrename ## Groups define op_grouplist operation exact grouplist define op_groupshow operation exact groupshow define op_groupadd operation exact groupadd define op_groupdel operation exact groupdel define op_grouprename operation exact grouprename define op_groupadduser operation exact groupadduser define op_groupdeluser operation exact groupdeluser define op_groupaddgroup operation exact groupaddgroup define op_groupdelgroup operation exact groupdelgroup define op_groupdescription operation exact groupdescription define op_group anyof op_grouplist op_groupshow op_groupadd op_groupdel op_groupadduser op_groupdeluser op_groupaddgroup op_groupdelgroup op_groupdescription op_grouprename ## Graveyard define op_graveyardlist operation exact graveyardlist define op_graveyardrestore operation exact graveyardrestore define op_graveyardpurge operation exact graveyardpurge define op_graveyard anyof op_graveyardlist op_graveyardrestore op_graveyardpurge ## Keyring define op_keyringlist operation exact keyringlist define op_keyringshow operation exact keyringshow define op_keyringcreate operation exact keyringcreate define op_keyringdestroy operation exact keyringdestroy define op_keyringaddkey operation exact keyringaddkey define op_keyringdelkey operation exact keyringdelkey define op_keyring anyof op_keyringlist op_keyringshow op_keyringcreate op_keyringdestroy op_keyringaddkey op_keyringdelkey ## Aggregation of admin ops define op_is_admin anyof op_user op_group op_graveyard op_keyring # Primary repository-related operations define op_read operation exact read define op_write operation exact write define op_createrepo operation exact createrepo define op_renamerepo operation exact renamerepo define op_destroyrepo operation exact destroyrepo # Remote configuration operations define op_config_show operation exact config_show define op_config_set operation exact config_set define op_config_del operation exact config_del define op_is_config anyof op_config_show op_config_set op_config_del # Reference update related operations define op_createref operation exact createref define op_deleteref operation exact deleteref define op_fastforward operation exact updaterefff define op_forcedupdate operation exact updaterefnonff # Combinator operations define op_is_basic anyof op_read op_write define op_is_update anyof op_fastforward op_forcedupdate define op_is_normal anyof op_fastforward op_createref op_deleteref # Administration define is_admin_repo repository exact gitano-admin define is_gitano_ref ref prefix refs/gitano/ define is_admin_ref ref exact refs/gitano/admin # Project readers and writers define is_project_reader config/project/readers exact ${user} define is_project_writer config/project/writers exact ${user}