Class GlobalPermissionControl

java.lang.Object
com.atlassian.bamboo.testutils.backdoor.BackdoorControl<GlobalPermissionControl>
com.atlassian.bamboo.testutils.backdoor.GlobalPermissionControl

public class GlobalPermissionControl extends BackdoorControl<GlobalPermissionControl>
Provides a way to deal with global permissions, for testing purposes.
  • Constructor Details

    • GlobalPermissionControl

      public GlobalPermissionControl(@NotNull @NotNull BambooEnvironmentData environmentData)
  • Method Details

    • tearDown

      public void tearDown()
      Description copied from class: BackdoorControl
      Cleanup resources
      Overrides:
      tearDown in class BackdoorControl<GlobalPermissionControl>
    • setAnonymousAccess

      public void setAnonymousAccess(boolean isEnabled)
      Updates the Anonymous Access global permission in the Bamboo instance.
      Parameters:
      isEnabled - true if anonymous access is to be allowed, false otherwise
    • getUserPermissions

      @NotNull public @NotNull List<BambooPermission> getUserPermissions(@NotNull @NotNull TestUser user) throws Exception
      Get current global user permissions.
      Throws:
      Exception
    • setUserPermissions

      public void setUserPermissions(@NotNull @NotNull TestUser testUser, @NotNull @NotNull Collection<BambooPermission> permissions) throws Exception
      Set global permissions for a user. This method can be used to revoke permissions.
      Throws:
      Exception
    • setLoggedUserPermission

      public void setLoggedUserPermission(Collection<BambooPermission> permissions)
      Updates the Logged in users global permissions in the Bamboo instance.
      Parameters:
      permissions - list of permissions to be granted
    • setLoggedUserPermission

      public void setLoggedUserPermission(BambooPermission... permissions)
      Updates the Logged in users global permissions in the Bamboo instance.
      Parameters:
      permissions - list of permissions to be granted
    • setLoggedUserPermission

      public void setLoggedUserPermission(Stream<BambooPermission> permissions)
      Updates the Logged in users global permissions in the Bamboo instance.
    • getGroupPermissions

      @NotNull public @NotNull List<BambooPermission> getGroupPermissions(@NotNull @NotNull TestGroup group) throws Exception
      Get current global group permissions.
      Throws:
      Exception
    • setGroupPermissions

      public void setGroupPermissions(@NotNull @NotNull TestGroup testGroup, @NotNull @NotNull Collection<BambooPermission> permissions) throws Exception
      Set global permissions for a user group. This method can be used to revoke permissions.
      Throws:
      Exception
    • getRolePermissions

      @NotNull public @NotNull List<BambooPermission> getRolePermissions(@NotNull @NotNull BambooRole role)
      Get current global role permissions.
    • setRolePermissions

      public void setRolePermissions(@NotNull @NotNull BambooRole role, @NotNull @NotNull Collection<BambooPermission> permissions)
      Set global role permissions. This method can be used to revoke permissions.
    • createResource

      protected javax.ws.rs.client.WebTarget createResource()
      Description copied from class: BackdoorControl
      Creates the resource that corresponds to the root of the TestKit REST API, using the values returned by BackdoorControl.getRestModulePath(). Note that the created WebResource has the following properties:
      • it logs all GET/POST/etc requests made through it
      • it sets the Content-Type: application/json by default (override with WebTarget.request(MediaType...))
      . To create a WebResource for a different root, use BackdoorControl.createResourceForPath(java.lang.String)
      Overrides:
      createResource in class BackdoorControl<GlobalPermissionControl>
      Returns:
      a WebResource for the TestKit REST API root
      See Also: