package com.l7tech.server.security.rbac;

import com.l7tech.gateway.common.security.rbac.Role;
import com.l7tech.gateway.common.security.rbac.Role.Tag;
import com.l7tech.identity.Group;
import com.l7tech.identity.User;
import com.l7tech.objectmodel.DeleteException;
import com.l7tech.objectmodel.EntityHeader;
import com.l7tech.objectmodel.EntityManager;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.objectmodel.imp.NamedEntityImp;
import com.l7tech.util.Pair;
import java.util.Collection;
import java.util.regex.Pattern;
import org.jetbrains.annotations.NotNull;
import org.springframework.transaction.annotation.Transactional;

public interface RoleManager extends EntityManager<Role, EntityHeader>, RbacServices {
   String ADMIN_REQUIRED = "At least one enabled User with no expiry must always be assigned to the Administrator role";

   @Transactional(readOnly = true)
   Collection<Role> getAssignedRoles(User var1) throws FindException;

   @Transactional(readOnly = true)
   Collection<Role> getAssignedRoles(@NotNull Group var1) throws FindException;

   @Transactional(readOnly = true)
   Collection<Role> getAssignedRoles(User var1, boolean var2, boolean var3) throws FindException;

   @Transactional(readOnly = true)
   Collection<Pair<Goid, String>> getExplicitRoleAssignments() throws FindException;

   @Transactional(readOnly = true)
   Role findByTag(Tag var1) throws FindException;

   @Transactional(readOnly = true)
   Collection<Role> findEntitySpecificRoles(EntityType var1, Goid var2) throws FindException;

   void deleteEntitySpecificRoles(EntityType var1, Goid var2) throws DeleteException;

   void deleteEntitySpecificPermissions(@NotNull EntityType var1, @NotNull String var2) throws DeleteException;

   void renameEntitySpecificRoles(EntityType var1, NamedEntityImp var2, Pattern var3) throws FindException, UpdateException;

   void validateRoleAssignments() throws UpdateException;

   void deleteRoleAssignmentsForUser(User var1) throws DeleteException;

   void deleteRoleAssignmentsForGroup(Group var1) throws DeleteException;

   class DisabledGroupRolesException extends FindException {
      static final long serialVersionUID = -4716198092468986704L;

      public DisabledGroupRolesException(String var1) {
         super(var1);
      }
   }
}
