com.atlassian.confluence.selenium.client
Class PagePermissionsEditor

java.lang.Object
  extended by com.atlassian.confluence.selenium.client.Dialog
      extended by com.atlassian.confluence.selenium.client.PagePermissionsEditor

public class PagePermissionsEditor
extends Dialog


Field Summary
static java.lang.String PERMISSIONS_DIALOG_ID
           
 
Fields inherited from class com.atlassian.confluence.selenium.client.Dialog
client, id
 
Method Summary
 void addContentPermission(ContentPermission contentPermission)
           
 void addEntitiesViaInputField(java.lang.String entitiesStr)
           
 void assertHasInheritedPermission(ContentPermission contentPermission, Page ancestor)
           
 void assertHasNoInheritedPermission(ContentPermission contentPermission, Page ancestor)
           
 void assertHasNoPermission(ContentPermission contentPermission)
           
 void assertHasPermission(ContentPermission contentPermission)
           
 void cancel()
          Clicks the Permissions dialog's "Cancel" button, to close the dialog without saving changes.
 GroupPickerPopup chooseGroup()
           
 UserPickerPopup chooseUser()
          Clicks the "Remove" row link to delete all permissions for an Entity
 void clickChooseMe()
           
 QuickNavBox getAutocomplete()
           
 ContentPermissionType getCurrentPermissionType()
           
 java.lang.String getDuplicateUserFlaggedJS(ContentPermission contentPermission)
          Returns true if the specified user is flagged as duplicated in the permissions table.
 java.lang.String getInheritedPermissionRowSelectorJS(ContentPermission contentPermission, Page ancestor)
           
 java.lang.String getPermissionRowSelectorJS(ContentPermission contentPermission)
           
 java.util.List<java.lang.String> getPermissions(ContentPermissionType permissionType, ContentPermissionEntityType entityType)
          Returns a list of the user names currently in the direct permission table with the given permission and entity type.
 java.lang.String getRemovePermissionRowLinkId(ContentPermission contentPermission)
           
 int getScrollPositionOfElement(java.lang.String selector)
          Returns the scrollTop of the element for the passed selector.
 boolean isPermissionInViewport(ContentPermission contentPermission)
          Returns true if the row for the passed permission is viewable in the scrollable tables div.
 void removePermission(ContentPermission contentPermission)
          Removed the permission for the given user or group with the supplied permission type.
 void setCurrentPermissionType(ContentPermissionType currentPermissionType)
          Sets the current ContentPermissionType choice in the PagePermissionsEditor by clicking the appropriate radio button.
 void typeUserName(java.lang.String name)
          Types text in the username "smart field", launching the field's dropdown if enough text is entered.
 void update()
          Clicks the Permissions dialog's "Update" button, which may either save the edited Permissions to the Page editor form (for Edit mode) or save the edited Permissions with AJAX (for View mode).
 void waitForUserNameDropDown()
          Waits until a 'smart field' drop down visible for the user name field
 void waitForUserNameDropDownToClose()
          Waits until a 'smart field' drop down is not visible for the user name field
 
Methods inherited from class com.atlassian.confluence.selenium.client.Dialog
clickButton, clickPageMenu, getId, getTitle, hasButton, isButtonDisabled, isVisible, pressEscape, waitUntilHidden, waitUntilVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERMISSIONS_DIALOG_ID

public static final java.lang.String PERMISSIONS_DIALOG_ID
See Also:
Constant Field Values
Method Detail

setCurrentPermissionType

public void setCurrentPermissionType(ContentPermissionType currentPermissionType)
Sets the current ContentPermissionType choice in the PagePermissionsEditor by clicking the appropriate radio button. This method will not fail if the restrictionTypeToAdd is already selected.


getCurrentPermissionType

public ContentPermissionType getCurrentPermissionType()

clickChooseMe

public void clickChooseMe()

addContentPermission

public void addContentPermission(ContentPermission contentPermission)

addEntitiesViaInputField

public void addEntitiesViaInputField(java.lang.String entitiesStr)

typeUserName

public void typeUserName(java.lang.String name)
Types text in the username "smart field", launching the field's dropdown if enough text is entered.


waitForUserNameDropDown

public void waitForUserNameDropDown()
Waits until a 'smart field' drop down visible for the user name field


waitForUserNameDropDownToClose

public void waitForUserNameDropDownToClose()
Waits until a 'smart field' drop down is not visible for the user name field


update

public void update()
Clicks the Permissions dialog's "Update" button, which may either save the edited Permissions to the Page editor form (for Edit mode) or save the edited Permissions with AJAX (for View mode).


cancel

public void cancel()
Clicks the Permissions dialog's "Cancel" button, to close the dialog without saving changes.


removePermission

public void removePermission(ContentPermission contentPermission)
Removed the permission for the given user or group with the supplied permission type.

Parameters:
contentPermission -

chooseUser

public UserPickerPopup chooseUser()
Clicks the "Remove" row link to delete all permissions for an Entity


chooseGroup

public GroupPickerPopup chooseGroup()

getPermissions

public java.util.List<java.lang.String> getPermissions(ContentPermissionType permissionType,
                                                       ContentPermissionEntityType entityType)
Returns a list of the user names currently in the direct permission table with the given permission and entity type.

Parameters:
permissionType - type of permission to retrieve, either "view" or "edit"
entityType - type of entity to retrieve, either "Users" or "Group" (note case)

assertHasPermission

public void assertHasPermission(ContentPermission contentPermission)

assertHasInheritedPermission

public void assertHasInheritedPermission(ContentPermission contentPermission,
                                         Page ancestor)

assertHasNoPermission

public void assertHasNoPermission(ContentPermission contentPermission)

assertHasNoInheritedPermission

public void assertHasNoInheritedPermission(ContentPermission contentPermission,
                                           Page ancestor)

getAutocomplete

public QuickNavBox getAutocomplete()

getDuplicateUserFlaggedJS

public java.lang.String getDuplicateUserFlaggedJS(ContentPermission contentPermission)
Returns true if the specified user is flagged as duplicated in the permissions table. This was by error message previously but is now done by highlighting the duplicate row.

Parameters:
contentPermission -

getPermissionRowSelectorJS

public java.lang.String getPermissionRowSelectorJS(ContentPermission contentPermission)

getInheritedPermissionRowSelectorJS

public java.lang.String getInheritedPermissionRowSelectorJS(ContentPermission contentPermission,
                                                            Page ancestor)

getRemovePermissionRowLinkId

public java.lang.String getRemovePermissionRowLinkId(ContentPermission contentPermission)

isPermissionInViewport

public boolean isPermissionInViewport(ContentPermission contentPermission)
Returns true if the row for the passed permission is viewable in the scrollable tables div.


getScrollPositionOfElement

public int getScrollPositionOfElement(java.lang.String selector)
Returns the scrollTop of the element for the passed selector.



Copyright © 2003-2010 Atlassian. All Rights Reserved.