Class ScopeDisplay
tags/scopeItem.jelly).
A window follows its item when an administrator (or a user with their own permissions)
renames or moves it (D-74 (3)), so its current full name can differ from the name the request
was approved for. The followed name is shown only to a viewer who may read the item now:
Visibility.findVisibleItem(java.lang.String) finds it as the viewer and the viewer holds Item/Read on it,
or the viewer is an administrator (who sees the current name even after the item was deleted).
Anyone else sees the approved name with a fixed note that the item was moved and its new
location is not visible to them; nothing else about the new location is passed to the view
(no link, no title, no kind resolved from the moved item). When the name did not change,
nothing changes: the approved name is shown to every viewer of the request as before.
A window whose request is no longer stored has no approved name. Its name is then shown only
under the same rule, and otherwise not at all (isNameHidden()).
Read-only and decided per rendering, as the viewer; no state, no permission switch.
-
Method Summary
Modifier and TypeMethodDescriptionThe full name to show: the window's current one when it did not change or the viewer may read the item, otherwise the approved one.booleanisMoved()Whether the item was renamed or moved where the viewer may not read it, so the screen showsgetFullName()(the approved name) with the fixed note instead of the current name.booleanWhether no name can be shown at all (a moved window whose request is no longer stored).static ScopeDisplayof(GrantScope approved, GrantScope current) The name to show for a request approved forapprovedwhose window now namescurrent.static ScopeDisplayof(GrantScope, GrantScope)by full names.
-
Method Details
-
of
The name to show for a request approved forapprovedwhose window now namescurrent.- Parameters:
approved- the item the request was made for, ornullwhen the request is not stored any morecurrent- the window's item (Grant#getScope()), ornullbefore there is a window
-
of
of(GrantScope, GrantScope)by full names. -
getFullName
The full name to show: the window's current one when it did not change or the viewer may read the item, otherwise the approved one.nullonly for a window whose request is no longer stored and whose item the viewer may not read. -
isMoved
public boolean isMoved()Whether the item was renamed or moved where the viewer may not read it, so the screen showsgetFullName()(the approved name) with the fixed note instead of the current name. -
isNameHidden
public boolean isNameHidden()Whether no name can be shown at all (a moved window whose request is no longer stored).
-