Interface SecurityService
- All Known Implementing Classes:
SecurityAllowEverythingService,SecurityServiceImpl
public interface SecurityService
Brings security to ReportServer.
-
Method Summary
Modifier and TypeMethodDescriptionvoidassertActions(Object target, Class<? extends SecurityAction>... actions) voidassertRights(Object target, Class<? extends Right>... rights) voidassertRights(Collection<User> users, Object target, Class<? extends Right>... rights) voidbooleancheckActions(Class<?> target, Class<? extends SecurityAction>... actions) booleancheckActions(SecurityTarget target, Class<? extends SecurityAction>... actions) Tests whether the givenSecurityActions are allowed to be performed by the givenSecurityTargetor not.booleancheckActions(User user, Class<?> target, Class<? extends SecurityAction>... actions) booleancheckActions(User user, SecurityTarget target, Class<? extends SecurityAction>... actions) booleancheckRights(Class<?> target, Class<? extends Right>... rights) booleanTests whether the target has the specified rights.booleancheckRights(Object target, Class<? extends Right>... rights) booleancheckRights(SecurityTarget target, boolean requireInheritance, Class<? extends Securee> securee, Class<? extends Right>... rights) booleancheckRights(SecurityTarget target, Class<? extends Right>... rights) Tests whether theSecurityTargethas the givenRights or not.booleancheckRights(SecurityTarget target, Class<? extends Securee> securee, Class<? extends Right>... rights) Tests whether the target has the specified rights.booleancheckRights(User user, Class<?> target, Class<? extends Securee> securee, Class<? extends Right>... rights) booleancheckRights(User user, SecurityTarget target, boolean requireInheritance, Class<? extends Securee> securee, Class<? extends Right>... rights) booleancheckRights(User user, SecurityTarget target, Class<? extends Securee> securee, Class<? extends Right>... rights) Tests whether the target has the specified rights.Creates a newAceand configures it with the given targetcreateACE(GenericSecurityTargetEntity entity) Creates a newAceand configures it with the given targetcreateGenericSecurityTargetEntity(Class<?> type) Creates and returns a new instance ofGenericSecurityTargetEntitywith the generic target identifier of the givenClass.createHierarchicalACE(Class<?> target) Creates a newHierarchicalAceand configures it with the given targetReturns aCollectionof all registeredSecureesClass<?> Returns the corresponding marker class.getKnownHostsFile(boolean appendFileCheck) Collection<Class<?>> Returns aCollectionofClasses of registered generic security targetsgetRegisteredSecureesForTarget(Class<?> target) Returns aCollectionofSecurees matching the given targetCollection<Class<? extends SecurityTarget>> Returs aCollectionof all registeredSecurityTargetsbooleanisEntitySecurityTarget(Class<?> type) Tests if the givenClassis aSecurityTargetbooleanisGenericTarget(Class<?> type) Tests if the givenClassis aGenericSecurityTargetbooleanisTypeSecured(Class<?> type) Tests whether theClasshas been registered.loadGenericTarget(Class<?> type) Loads aGenericSecurityTargetEntityby the generic target identifier of the givenClassLoads aGenericSecurityTargetEntityby the given generic target identifierMerges the givenAcewith the representation in the database and returns the result.Merges the givenAclwith the representation in the database and returns the result.merge(GenericSecurityTargetEntity targetEntity) Merges the givenGenericSecurityTargetEntitywith the representation in the database and returns the result.voidPersists the givenAcevoidPersists the givenAcl.voidregisterSecuree(Securee securee) Registers the givenSecureewith the systemvoidregisterSecurityTarget(Class<?>... types) Registers a new type as a security target adding only the default rights.voidregisterSecurityTarget(Class<?> type, Securee securee) voidregisterSecurityTarget(SecurityTargetConfiguration... configs) Allows a module to register one or more security targets.voidRemoves the givenAcefrom the databasevoidRemoves the givenAclfrom the database.
-
Method Details
-
registerSecuree
Registers the givenSecureewith the system- Parameters:
securee- TheSecuree
-
getAllRegisteredSecurees
Collection<Securee> getAllRegisteredSecurees()Returns aCollectionof all registeredSecurees- Returns:
- A
CollectionofSecurees
-
registerSecurityTarget
Allows a module to register one or more security targets.- Parameters:
configs- One or more instances ofSecurityTargetConfiguration
-
registerSecurityTarget
-
registerSecurityTarget
Registers a new type as a security target adding only the default rights.- Parameters:
types- One or moreClasses to be registered
-
getRegisteredSecureesForTarget
Returns aCollectionofSecurees matching the given target- Parameters:
target- AClassdefining the type of the target- Returns:
- A
CollectionofSecurees
-
getRegisteredGenericSecurityTargets
Collection<Class<?>> getRegisteredGenericSecurityTargets()Returns aCollectionofClasses of registered generic security targets- Returns:
- A
CollectionofClasses
-
getRegisteredSecurityTargets
Collection<Class<? extends SecurityTarget>> getRegisteredSecurityTargets()Returs aCollectionof all registeredSecurityTargets- Returns:
- A
CollectionofSecurityTargets
-
checkRights
Tests whether theSecurityTargethas the givenRights or not.- Parameters:
target- TheSecurityTargetrights- A list ofRights to test- Returns:
- true if the tests passed; false otherwise
-
checkRights
-
checkRights
boolean checkRights(SecurityTarget target, Class<? extends Securee> securee, Class<? extends Right>... rights) Tests whether the target has the specified rights.- Parameters:
target- TheSecurityTargetsecuree- TheSecureerights- A list ofRights to test- Returns:
- true if the tests passed; false otherwise
-
checkActions
Tests whether the givenSecurityActions are allowed to be performed by the givenSecurityTargetor not.- Parameters:
target- TheSecurityTargetactions- A list ofSecurityActions- Returns:
- true if the tests passed; false otherwise
-
checkRights
boolean checkRights(User user, SecurityTarget target, Class<? extends Securee> securee, Class<? extends Right>... rights) Tests whether the target has the specified rights.- Parameters:
user- TheUsertarget-securee-rights-
-
checkRights
-
checkRights
boolean checkRights(SecurityTarget target, boolean requireInheritance, Class<? extends Securee> securee, Class<? extends Right>... rights) -
checkActions
-
checkRights
boolean checkRights(Class<?> target, Class<? extends Securee> securee, Class<? extends Right>... rights) Tests whether the target has the specified rights.- Parameters:
target-rights-
-
checkRights
-
checkActions
-
checkRights
-
checkActions
-
isTypeSecured
Tests whether theClasshas been registered. -
isGenericTarget
Tests if the givenClassis aGenericSecurityTarget- Parameters:
type- TheClassto test- Returns:
- true if the given
Classis aGenericSecurityTarget; false otherwise
-
isEntitySecurityTarget
Tests if the givenClassis aSecurityTarget- Parameters:
type- TheClassto test- Returns:
- true if the given
Classis aSecurityTarget; false otherwise
-
createGenericSecurityTargetEntity
Creates and returns a new instance ofGenericSecurityTargetEntitywith the generic target identifier of the givenClass.- Parameters:
type- TheClassto use the generic target identifier from- Returns:
- A new instance of
GenericSecurityTargetEntity
-
merge
Merges the givenGenericSecurityTargetEntitywith the representation in the database and returns the result.- Parameters:
targetEntity- TheGenericSecurityTargetEntitywith the new data- Returns:
- The merged
GenericSecurityTargetEntity
-
loadGenericTarget
Loads aGenericSecurityTargetEntityby the generic target identifier of the givenClass- Parameters:
type- TheClassto get the generic target identifier- Returns:
- The loaded
GenericSecurityTargetEntity
-
loadGenericTargetByIdentifier
Loads aGenericSecurityTargetEntityby the given generic target identifier- Parameters:
id- The generic target identifier- Returns:
- The loaded
GenericSecurityTargetEntity
-
getGenericTargetMarkerById
Returns the corresponding marker class.- Parameters:
id- The id to identify the marker class- Returns:
- The marker class
- See Also:
-
persist
Persists the givenAcl.- Parameters:
acl- TheAclto persist
-
merge
Merges the givenAclwith the representation in the database and returns the result. -
remove
Removes the givenAclfrom the database.- Parameters:
acl- TheAclto remove
-
persist
Persists the givenAce- Parameters:
ace- TheAceto persist
-
merge
Merges the givenAcewith the representation in the database and returns the result. -
remove
Removes the givenAcefrom the database- Parameters:
ace- TheAceto remove from the database
-
createACE
Creates a newAceand configures it with the given target -
createACE
Creates a newAceand configures it with the given target- Parameters:
entity- AGenericSecurityTargetEntityholding the target marker id- Returns:
- The newly created
Ace
-
createHierarchicalACE
Creates a newHierarchicalAceand configures it with the given target- Parameters:
target- The targetClass- Returns:
- The newly created
HierarchicalAce
-
assertRights
-
assertActions
-
assertRights
-
assertUserLoggedIn
void assertUserLoggedIn() -
getSupportedSslProtocols
-
getDefaultSslProtocols
-
getEnabledSslProtocols
-
getKnownHostsFile
-
getStrictHostKeyChecking
-