Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
f7643d99
Commit
f7643d99
authored
11 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-1033: add edit links to the owners (but without author's role) of a resource
parent
ebe6d81b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/repository/controllers/RepositoryDetailsController.java
+12
-14
12 additions, 14 deletions
...t/repository/controllers/RepositoryDetailsController.java
with
12 additions
and
14 deletions
src/main/java/org/olat/repository/controllers/RepositoryDetailsController.java
+
12
−
14
View file @
f7643d99
...
...
@@ -547,11 +547,9 @@ public class RepositoryDetailsController extends BasicController implements Gene
boolean
canCopy
=
repositoryEntry
.
getCanCopy
();
if
(
isOwner
)
{
if
(
isNewController
)
{
if
(
isAuthor
)
{
detailsToolC
.
addLink
(
ACTION_EDIT
,
translate
(
"details.openeditor"
),
TOOL_EDIT
,
null
,
"o_sel_repo_open_editor"
,
false
);
detailsToolC
.
addLink
(
ACTION_EDITDESC
,
translate
(
"details.chdesc"
),
TOOL_CHDESC
,
null
,
"o_sel_repo_edit_descritpion"
,
false
);
detailsToolC
.
addLink
(
ACTION_EDITPROP
,
translate
(
"details.chprop"
),
TOOL_CHPROP
,
null
,
"o_sel_repor_edit_properties"
,
false
);
}
detailsToolC
.
addLink
(
ACTION_EDIT
,
translate
(
"details.openeditor"
),
TOOL_EDIT
,
null
,
"o_sel_repo_open_editor"
,
false
);
detailsToolC
.
addLink
(
ACTION_EDITDESC
,
translate
(
"details.chdesc"
),
TOOL_CHDESC
,
null
,
"o_sel_repo_edit_descritpion"
,
false
);
detailsToolC
.
addLink
(
ACTION_EDITPROP
,
translate
(
"details.chprop"
),
TOOL_CHPROP
,
null
,
"o_sel_repor_edit_properties"
,
false
);
detailsToolC
.
addLink
(
ACTION_ADD_CATALOG
,
translate
(
"details.catadd"
),
TOOL_CATALOG
,
null
,
"o_sel_repo_add_to_catalog"
,
false
);
detailsToolC
.
addHeader
(
translate
(
"table.action"
));
...
...
@@ -596,12 +594,10 @@ public class RepositoryDetailsController extends BasicController implements Gene
}
// enable
if
(
isAuthor
)
{
boolean
editManaged
=
RepositoryEntryManagedFlag
.
isManaged
(
repositoryEntry
,
RepositoryEntryManagedFlag
.
editcontent
);
detailsToolC
.
setEnabled
(
TOOL_EDIT
,
handler
.
supportsEdit
(
repositoryEntry
)
&&
!
corrupted
&&
!
editManaged
);
detailsToolC
.
setEnabled
(
TOOL_CHDESC
,
!
corrupted
);
detailsToolC
.
setEnabled
(
TOOL_CHPROP
,
!
corrupted
);
}
boolean
editManaged
=
RepositoryEntryManagedFlag
.
isManaged
(
repositoryEntry
,
RepositoryEntryManagedFlag
.
editcontent
);
detailsToolC
.
setEnabled
(
TOOL_EDIT
,
handler
.
supportsEdit
(
repositoryEntry
)
&&
!
corrupted
&&
!
editManaged
);
detailsToolC
.
setEnabled
(
TOOL_CHDESC
,
!
corrupted
);
detailsToolC
.
setEnabled
(
TOOL_CHPROP
,
!
corrupted
);
canCopy
=
true
;
}
...
...
@@ -626,7 +622,7 @@ public class RepositoryDetailsController extends BasicController implements Gene
if
(
repositoryEntry
!=
null
)
{
// The controller has already a repository-entry => do de-register it
CoordinatorManager
.
getInstance
().
getCoordinator
().
getEventBus
().
deregisterFor
(
this
,
repositoryEntry
);
}
}
repositoryEntry
=
entry
;
CoordinatorManager
.
getInstance
().
getCoordinator
().
getEventBus
().
registerFor
(
this
,
ureq
.
getIdentity
(),
repositoryEntry
);
checkSecurity
(
ureq
);
...
...
@@ -778,7 +774,9 @@ public class RepositoryDetailsController extends BasicController implements Gene
* @param contentController
*/
private
void
doEditSettings
(
UserRequest
ureq
,
Controller
contentController
,
String
title
)
{
if
(!
isAuthor
)
throw
new
OLATSecurityException
(
"Trying to edit properties , but user is not author: user = "
+
ureq
.
getIdentity
());
if
(!
isAuthor
&&
!
isOwner
)
{
throw
new
OLATSecurityException
(
"Trying to edit properties , but user is not author: user = "
+
ureq
.
getIdentity
());
}
Component
component
=
contentController
.
getInitialComponent
();
...
...
@@ -1188,7 +1186,7 @@ public class RepositoryDetailsController extends BasicController implements Gene
* @return
*/
public
ToolController
getDetailsToolController
()
{
return
this
.
detailsToolC
;
return
detailsToolC
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment