001/* 002 * Copyright 2016 Anyware Services 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.ametys.plugins.repository; 017 018import java.util.Set; 019 020import org.ametys.core.group.GroupIdentity; 021import org.ametys.core.user.UserIdentity; 022 023/** 024 * {@link ACLAmetysObject} that can store and modify its profile assignements. 025 */ 026public interface ModifiableACLAmetysObject extends ACLAmetysObject 027{ 028 /** 029 * Adds allowed profiles any connected user has on this ametys object 030 * @param profileIds The profiles to add 031 */ 032 public void addAllowedProfilesForAnyConnectedUser(Set<String> profileIds); 033 034 /** 035 * Removes allowed profiles any connected user has on this ametys object 036 * @param profileIds The profiles to remove 037 */ 038 public void removeAllowedProfilesForAnyConnectedUser(Set<String> profileIds); 039 040 /** 041 * Adds denied profiles any connected user has on this ametys object 042 * @param profileIds The profiles to add 043 */ 044 public void addDeniedProfilesForAnyConnectedUser(Set<String> profileIds); 045 046 /** 047 * Removes denied profiles any connected user has on this ametys object 048 * @param profileIds The profiles to remove 049 */ 050 public void removeDeniedProfilesForAnyConnectedUser(Set<String> profileIds); 051 052 /** 053 * Adds allowed profiles an anonymous user has on this ametys object 054 * @param profileIds The profiles to add 055 */ 056 public void addAllowedProfilesForAnonymous(Set<String> profileIds); 057 058 /** 059 * Removes allowed profiles an anonymous user has on this ametys object 060 * @param profileIds The profiles to remove 061 */ 062 public void removeAllowedProfilesForAnonymous(Set<String> profileIds); 063 064 /** 065 * Adds denied profiles an anonymous user has on this ametys object 066 * @param profileIds The profiles to add 067 */ 068 public void addDeniedProfilesForAnonymous(Set<String> profileIds); 069 070 /** 071 * Removes denied profiles an anonymous user has on this ametys object 072 * @param profileIds The profiles to remove 073 */ 074 public void removeDeniedProfilesForAnonymous(Set<String> profileIds); 075 076 /** 077 * Associates some users with an allowed profile on this ametys object 078 * @param users The users to add 079 * @param profileId The id of the profile 080 */ 081 public void addAllowedUsers(Set<UserIdentity> users, String profileId); 082 083 /** 084 * Removes the association between some users and an allowed profile on this ametys object 085 * @param users The users to remove 086 * @param profileId The id of the profile 087 */ 088 public void removeAllowedUsers(Set<UserIdentity> users, String profileId); 089 090 /** 091 * Removes the association between some users and all allowed profiles on this ametys object 092 * @param users The users to remove 093 */ 094 public void removeAllowedUsers(Set<UserIdentity> users); 095 096 /** 097 * Associates some groups with an allowed profile on this ametys object 098 * @param groups The groups to add 099 * @param profileId The id of the profile 100 */ 101 public void addAllowedGroups(Set<GroupIdentity> groups, String profileId); 102 103 /** 104 * Removes the association between some groups and an allowed profile on this ametys object 105 * @param groups The groups to remove 106 * @param profileId The id of the profile 107 */ 108 public void removeAllowedGroups(Set<GroupIdentity> groups, String profileId); 109 110 /** 111 * Removes the association between some groups and all allowed profiles on this ametys object 112 * @param groups The groups to remove 113 */ 114 public void removeAllowedGroups(Set<GroupIdentity> groups); 115 116 /** 117 * Associates some users with a denied profile on this ametys object 118 * @param users The users to add 119 * @param profileId The id of the profile 120 */ 121 public void addDeniedUsers(Set<UserIdentity> users, String profileId); 122 123 /** 124 * Removes the association between some users and an denied profile on this ametys object 125 * @param users The users to remove 126 * @param profileId The id of the profile 127 */ 128 public void removeDeniedUsers(Set<UserIdentity> users, String profileId); 129 130 /** 131 * Removes the association between some users and all denied profiles on this ametys object 132 * @param users The users to remove 133 */ 134 public void removeDeniedUsers(Set<UserIdentity> users); 135 136 /** 137 * Associates some groups with an allowed profile on this ametys object 138 * @param groups The groups to add 139 * @param profileId The id of the profile 140 */ 141 public void addDeniedGroups(Set<GroupIdentity> groups, String profileId); 142 143 /** 144 * Removes the association between some groups and an allowed profile on this ametys object 145 * @param groups The groups to remove 146 * @param profileId The id of the profile 147 */ 148 public void removeDeniedGroups(Set<GroupIdentity> groups, String profileId); 149 150 /** 151 * Removes the association between some groups and all allowed profiles on this ametys object 152 * @param groups The groups to remove 153 */ 154 public void removeDeniedGroups(Set<GroupIdentity> groups); 155 156 /** 157 * Allow or disallow inheritance of permissions 158 * @param disallow true to disallow inheritance 159 */ 160 public void disallowInheritance(boolean disallow); 161}