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
ee91a8f0
Commit
ee91a8f0
authored
5 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-4489: create/import only for author rights in group administration
parent
66ed8b2a
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/group/ui/edit/BusinessGroupEditResourceController.java
+21
-15
21 additions, 15 deletions
...at/group/ui/edit/BusinessGroupEditResourceController.java
with
21 additions
and
15 deletions
src/main/java/org/olat/group/ui/edit/BusinessGroupEditResourceController.java
+
21
−
15
View file @
ee91a8f0
...
...
@@ -49,6 +49,7 @@ import org.olat.core.gui.control.generic.closablewrapper.CloseableModalControlle
import
org.olat.core.gui.control.generic.modal.DialogBoxController
;
import
org.olat.core.gui.control.generic.modal.DialogBoxUIFactory
;
import
org.olat.core.gui.translator.Translator
;
import
org.olat.core.id.Roles
;
import
org.olat.core.util.Util
;
import
org.olat.course.CourseModule
;
import
org.olat.group.BusinessGroup
;
...
...
@@ -92,6 +93,8 @@ public class BusinessGroupEditResourceController extends BasicController impleme
private
BusinessGroup
group
;
private
final
boolean
managed
;
private
final
boolean
hasAuthorRight
;
@Autowired
private
BusinessGroupService
businessGroupService
;
...
...
@@ -108,6 +111,9 @@ public class BusinessGroupEditResourceController extends BasicController impleme
this
.
group
=
group
;
managed
=
BusinessGroupManagedFlag
.
isManaged
(
group
,
BusinessGroupManagedFlag
.
resources
);
Roles
roles
=
ureq
.
getUserSession
().
getRoles
();
hasAuthorRight
=
roles
.
isAdministrator
()
||
roles
.
isLearnResourceManager
()
||
roles
.
isAuthor
();
Translator
resourceTrans
=
Util
.
createPackageTranslator
(
RepositoryService
.
class
,
getLocale
(),
getTranslator
());
TableGuiConfiguration
tableConfig
=
new
TableGuiConfiguration
();
tableConfig
.
setTableEmptyMessage
(
translate
(
"resources.noresources"
));
...
...
@@ -130,24 +136,10 @@ public class BusinessGroupEditResourceController extends BasicController impleme
putInitialPanel
(
mainVC
);
}
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
*/
@Override
public
void
event
(
UserRequest
ureq
,
Component
source
,
Event
event
)
{
if
(
source
==
addTabResourcesButton
)
{
removeAsListenerAndDispose
(
repoSearchCtr
);
removeAsListenerAndDispose
(
cmc
);
RepositoryEntryFilter
filter
=
new
ManagedEntryfilter
();
repoSearchCtr
=
new
ReferencableEntriesSearchController
(
getWindowControl
(),
ureq
,
new
String
[]{
CourseModule
.
getCourseTypeName
()
},
filter
,
translate
(
"resources.add"
),
true
,
true
,
true
,
false
,
true
,
Can
.
referenceable
);
listenTo
(
repoSearchCtr
);
cmc
=
new
CloseableModalController
(
getWindowControl
(),
translate
(
"close"
),
repoSearchCtr
.
getInitialComponent
(),
true
,
translate
(
"resources.add.title"
));
listenTo
(
cmc
);
cmc
.
activate
();
doAddRepositoryEntry
(
ureq
);
}
}
...
...
@@ -197,6 +189,20 @@ public class BusinessGroupEditResourceController extends BasicController impleme
}
}
private
void
doAddRepositoryEntry
(
UserRequest
ureq
)
{
removeAsListenerAndDispose
(
repoSearchCtr
);
removeAsListenerAndDispose
(
cmc
);
RepositoryEntryFilter
filter
=
new
ManagedEntryfilter
();
repoSearchCtr
=
new
ReferencableEntriesSearchController
(
getWindowControl
(),
ureq
,
new
String
[]{
CourseModule
.
getCourseTypeName
()
},
filter
,
translate
(
"resources.add"
),
hasAuthorRight
,
hasAuthorRight
,
true
,
false
,
true
,
Can
.
referenceable
);
listenTo
(
repoSearchCtr
);
cmc
=
new
CloseableModalController
(
getWindowControl
(),
translate
(
"close"
),
repoSearchCtr
.
getInitialComponent
(),
true
,
translate
(
"resources.add.title"
));
listenTo
(
cmc
);
cmc
.
activate
();
}
private
void
doOpenInfos
(
UserRequest
ureq
,
RepositoryEntry
repositoryEntry
,
int
rowId
)
{
removeAsListenerAndDispose
(
calloutCtrl
);
removeAsListenerAndDispose
(
infosCtrl
);
...
...
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