@Deprecated public interface

DeprecatedSecurityService

com.atlassian.stash.user.DeprecatedSecurityService
Known Indirect Subclasses

This interface is deprecated.
in 2.12 and scheduled for removal in 4.0. This interface will be removed and SecurityService will no longer extend this interface.

Summary

Public Methods
@Deprecated <T, E extends Throwable> T doAnonymously(String reason, Operation<T, E> operation)
This method is deprecated. since 2.12, scheduled for removal in 4.0. Use anonymously(String) instead.
@Deprecated <T, E extends Throwable> T doAsUser(String reason, String userName, Operation<T, E> operation)
This method is deprecated. since 2.12, scheduled for removal in 4.0. Use impersonating(StashUser, String) instead.
@Deprecated <T, E extends Throwable> T doWithPermission(String reason, Permission permission, Operation<T, E> operation)
This method is deprecated. since 2.12, scheduled for removal in 4.0. Use withPermission(Permission, String) instead.
@Deprecated <T, E extends Throwable> T doWithPermissions(String reason, Collection<Permission> permissions, Operation<T, E> operation)
This method is deprecated. since 2.12, scheduled for removal in 4.0. Use withPermissions(java.util.Set, String) instead.

Public Methods

@Deprecated public T doAnonymously (String reason, Operation<T, E> operation)

This method is deprecated.
since 2.12, scheduled for removal in 4.0. Use anonymously(String) instead.

Execute an Operation anonymously (not as any user)

Parameters
reason reason for running as a different user. Helpful for logging/debugging
operation the Operation to perform.
Returns
  • the return value of Operation.perform()
Throws
when thrown by Operation.perform()
Throwable

@Deprecated public T doAsUser (String reason, String userName, Operation<T, E> operation)

This method is deprecated.
since 2.12, scheduled for removal in 4.0. Use impersonating(StashUser, String) instead.

Execute an Operation as a particular user.

Parameters
reason reason for running as a different user. Helpful for logging/debugging
userName a String naming the user to impersonate.
operation the Operation to perform.
Returns
  • the return value of Operation.perform()
Throws
when thrown by Operation.perform()
PreAuthenticationFailedException when authenticating as userName failed
Throwable

@Deprecated public T doWithPermission (String reason, Permission permission, Operation<T, E> operation)

This method is deprecated.
since 2.12, scheduled for removal in 4.0. Use withPermission(Permission, String) instead.

Executes an Operation as the current user, but with elevated permission.

Note: nested invocations results in all elevated permissions taking effect rather than replacing the previous elevated permissions

Parameters
reason the reason for the elevation of permissions. Helpful for logging/debugging
permission the permission to temporarily grant to the current user.
operation the operation to perform
Returns
  • the return value of Operation.perform()
Throws
when thrown by Operation.perform()
Throwable

@Deprecated public T doWithPermissions (String reason, Collection<Permission> permissions, Operation<T, E> operation)

This method is deprecated.
since 2.12, scheduled for removal in 4.0. Use withPermissions(java.util.Set, String) instead.

Executes an Operation as the current user, but with elevated permission.

Note: nested invocations results in all elevated permissions taking effect rather than replacing the previous elevated permissions

Parameters
reason the reason for the elevation of permissions. Helpful for logging/debugging
permissions the permissions to temporarily grant to the current user.
operation the operation to perform
Returns
  • the return value of Operation.perform()
Throws
when thrown by Operation.perform()
Throwable