Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rt
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
best-practical
rt
Commits
f408beef
Commit
f408beef
authored
14 years ago
by
Alex Vandiver
Browse files
Options
Downloads
Patches
Plain Diff
We don't care about the list of objects, only if it is empty or not
parent
e0fc7782
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/RT/Dashboard.pm
+22
-0
22 additions, 0 deletions
lib/RT/Dashboard.pm
share/html/Elements/Tabs
+1
-1
1 addition, 1 deletion
share/html/Elements/Tabs
with
23 additions
and
1 deletion
lib/RT/Dashboard.pm
+
22
−
0
View file @
f408beef
...
...
@@ -404,6 +404,28 @@ sub ObjectsForLoading {
return
@objects
;
}
sub
CurrentUserCanCreateAny
{
my
$self
=
shift
;
my
@objects
;
my
$CurrentUser
=
$self
->
CurrentUser
;
return
1
if
$CurrentUser
->
HasRight
(
Object
=>
$
RT::
System
,
Right
=>
'
CreateOwnDashboard
');
my
$groups
=
RT::
Groups
->
new
(
$CurrentUser
);
$groups
->
LimitToUserDefinedGroups
;
$groups
->
ForWhichCurrentUserHasRight
(
Right
=>
'
CreateGroupDashboard
',
IncludeSuperusers
=>
1
,
);
return
1
if
$groups
->
Count
;
return
1
if
$CurrentUser
->
HasRight
(
Object
=>
$
RT::
System
,
Right
=>
'
CreateDashboard
');
return
0
;
}
RT::
Base
->
_ImportOverlays
();
1
;
This diff is collapsed.
Click to expand it.
share/html/Elements/Tabs
+
1
−
1
View file @
f408beef
...
...
@@ -90,7 +90,7 @@ if ( $request_path !~ qr{^/SelfService/} ) {
$dashes->child( select => title => loc('Select'), path => "/Dashboards/index.html" );
my $dashboard = RT::Dashboard->new( $session{CurrentUser} );
if ( $dashboard->
ObjectsFor
Creat
ing
) {
if ( $dashboard->
CurrentUserCan
Creat
eAny
) {
$dashes->child( loc('Create') => path => "/Dashboards/Modify.html?Create=1" );
}
...
...
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