-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client upgraded permissions sub super #147
Open
JamieHooper-code
wants to merge
9
commits into
synergycp:master
Choose a base branch
from
JamieHooper-code:client-upgraded-permissions-sub-super
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7e312b6
Merge pull request #134 from synergycp/04-25-612323405-2018
cabloo 108aeb1
Merge pull request #136 from synergycp/04-25-612323405-2018
cabloo 25b1025
Merge pull request #141 from synergycp/04-25-612323405-2018
cabloo ce1e854
Merge pull request #143 from synergycp/04-25-612323405-2018
cabloo b2b279d
Merge branch 'develop' of github.com:synergycp/scp-theme-client into …
JamieHooper-code 5d995a9
user-sidebar-updates
JamieHooper-code 8344dcb
server-page-changes
JamieHooper-code bc443f0
changesg
JamieHooper-code aa00bf2
changes
JamieHooper-code File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
angular | ||
.module('app.user') | ||
.config(NavConfig) | ||
; | ||
|
||
/** | ||
* @ngInject | ||
*/ | ||
function NavConfig(NavProvider) { | ||
NavProvider | ||
.group('user', { | ||
translate: "nav.USERS", | ||
sref: "app.account.settings", | ||
icon: "fa fa-user", | ||
}); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,62 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
var MY_ACCOUNT = { | ||
text: "My Account", | ||
sref: "app.account.settings", | ||
}; | ||
|
||
var SUB_CLIENTS = { | ||
text: "Sub Clients", | ||
sref: "app.user.client.sub.list", | ||
}; | ||
|
||
var SUPER_CLIENTS = { | ||
text: "Super Clients", | ||
sref: "app.user.client.super.list", | ||
}; | ||
|
||
angular | ||
.module('app.user') | ||
.config(NavConfig) | ||
.run(UserSidebarShowWithPermissions) | ||
; | ||
|
||
/** | ||
* @ngInject | ||
*/ | ||
function NavConfig(NavProvider) { | ||
NavProvider.group('user', { | ||
translate: "nav.USERS", | ||
sref: "app.account.settings", | ||
icon: "fa fa-user", | ||
}).item({ | ||
text: "My Account", | ||
sref: "app.account.settings", | ||
}).item({ | ||
text: "Sub Clients", | ||
sref: "app.user.client.sub.list", | ||
}).item({ | ||
text: "Super Clients", | ||
sref: "app.user.client.super.list" | ||
}); | ||
function UserSidebarShowWithPermissions(Auth, Select /*, Permission*/) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. permission can't be imported because this is the client side. Clients don't have permissions - only Admins & Integrations do. We need a way of getting this information off of the client account, e.g. |
||
var userSidebar = this; | ||
//Need to import Auth and Permission here. Why doesn't this work? in install.nav.config.js and search.tab.js | ||
//this is used in seemingly the exact same way. | ||
userSidebar.group = Select('group'); | ||
// var group = NavProvider.group('user', { | ||
// translate: "nav.USERS", | ||
// sref: "app.account.settings", | ||
// icon: "fa fa-user", | ||
// }); | ||
|
||
Auth.whileLoggedIn(showPermitted, hide); | ||
|
||
// function show() { | ||
// Permission | ||
// .map() | ||
// .then(showPermitted) | ||
// ; | ||
// } | ||
|
||
function showPermitted(map) { | ||
group.item(MY_ACCOUNT); | ||
|
||
// if (showSubAndSuperClientPages) { | ||
group.item(SUB_CLIENTS); | ||
group.item(SUPER_CLIENTS); | ||
// } | ||
} | ||
|
||
function hide() { | ||
group.remove(MY_ACCOUNT); | ||
group.remove(SUB_CLIENTS); | ||
group.remove(SUPER_CLIENTS); | ||
} | ||
} | ||
})(); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is a function, you would need to use
assign.client.subSuperAccess()
instead ofassign.client.subSuperAccess
to get the returned value from the function.We'll need this implemented for real, what's the plan here? We would need to fetch this off of the authenticated user's account details. Since we'd be using this in multiple places, we may need to add another service to get & cache this information, or maybe we can cache it with the user details (like user name)?