You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Marty Godsey <ma...@gonsource.com> on 2016/08/17 22:46:51 UTC

Hiding buttons based on role

Is it possible to hide a button based upon a role? As an example I want to hide and deny access to the projects tab. I can modify the role access to the API but the button is still present. In fact I get an API error that states I don't have access.

Regards,
Marty Godsey


Re: Hiding buttons based on role

Posted by Frank Maximus <fr...@nuagenetworks.net>.
Filters on action are already used for vm's.
See vmActionfilter in instances.js.
Also for the sections I can find a sectionPreFilter in cloudStack.js
That seems to check the response of listCapabilities for
'allowusercreateprojects'.

Kind Regards,
Frank



*Frank Maximus *

Senior Software Development Engineer



*nuage*networks.net
​Copernicuslaan 50

2018 Antwerp

Belgium



p: +32 3 240 73 81


On Fri, Aug 19, 2016 at 1:41 AM, Marty Godsey <ma...@gonsource.com> wrote:

> That would be great. I think adding the ability hide GUI elements based on
> role inside the GUI would be a great step.
>
> Regards,
> Marty Godsey
>
> -----Original Message-----
> From: Rashmi Dixit [mailto:rashmi_dixit@accelerite.com]
> Sent: Thursday, August 18, 2016 8:15 AM
> To: dev@cloudstack.apache.org
> Subject: RE: Hiding buttons based on role
>
> Hi Marty,
>
> We could add an "actionPreFilter" for "actions" defined in the widgets
> which will filter out the buttons based on role.
>
> There are preFilters already implemented for fields in a listView - we
> need to follow the same principle. We need to check for this filter where
> the buttons are built in the listView (look for "if (listViewData.actions)
> {" in listView.js).
>
> Hope this helps!
> Rashmi
>
>
>
> -----Original Message-----
> From: Marty Godsey [mailto:marty@gonsource.com]
> Sent: Thursday, August 18, 2016 6:04 AM
> To: dev@cloudstack.apache.org
> Subject: RE: Hiding buttons based on role
>
> Not elegant but will work. This is not a one off to a degree. It's for my
> own servers but I will have at least 10-20 management server across the
> country in different zones  but this allows me to "hide" some elements that
> won't be used until a more elegant way is created/available.
>
> Thank you for the direction Will.
>
> Regards,
> Marty Godsey
>
> -----Original Message-----
> From: Will Stevens [mailto:williamstevens@gmail.com]
> Sent: Wednesday, August 17, 2016 8:29 PM
> To: dev@cloudstack.apache.org
> Subject: RE: Hiding buttons based on role
>
> If I was doing a one off solution for my own use case with a limited
> scope, I would do it he following.
>
> Apply a CSS class to the <body> tag which corresponds to the role. Then I
> would use CSS to 'display:none' on the elements you want to turn off by
> referencing the body role class (and keep the permissions applied so if
> they unhide it won't work).
>
> It is not an elegant solution, but it will work.
>
> On Aug 17, 2016 8:19 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
>
> >
>
> > Ok. Thank you.
> >
> > I think for the time being I will enable all the project APIs again
> > but
> deny access to create a project.. this way at least he API errors on page
> load go away.
> >
> > This is something I think would be nice to have in the permissions
> > area
> now since we have granular rules. A way to "turn off" certain areas of the
> GUI and/or ACS functionality.
> >
> > Regards,
> > Marty Godsey
> >
> > -----Original Message-----
> > From: Will Stevens [mailto:williamstevens@gmail.com]
> > Sent: Wednesday, August 17, 2016 8:10 PM
> > To: dev@cloudstack.apache.org
> > Subject: RE: Hiding buttons based on role
> >
> > Yes. Most of the UI is built using huge json structures. These will
> > need
> to be adapted to account for a user's role. I don't think there has been
> work done on that yet, but I could be wrong.
> >
> > @rohit, do you know if anyone has looked into this at all yet?
> >
> > On Aug 17, 2016 7:41 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
> >
> > > With that being said, we are now getting into the area of UI
> > > modification to hide the button huh?
> > >
> > > Regards,
> > > Marty Godsey
> > >
> > > -----Original Message-----
> > > From: Will Stevens [mailto:williamstevens@gmail.com]
> > > Sent: Wednesday, August 17, 2016 7:23 PM
> > > To: dev@cloudstack.apache.org
> > > Subject: Re: Hiding buttons based on role
> > >
> > > My understanding is that the permissions can be set, but they
> > > currently do not modify the UI in any way. I believe what you are
> > > experiencing is the expected behavior.
> > >
> > > Cheers,
> > >
> > > Will
> > >
> > > On Aug 17, 2016 6:47 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
> > >
> > > > Is it possible to hide a button based upon a role? As an example I
> > > > want to hide and deny access to the projects tab. I can modify the
> > > > role access to the API but the button is still present. In fact I
> > > > get an API error that states I don't have access.
> > > >
> > > > Regards,
> > > > Marty Godsey
> > > >
> > > >
> > >
>
>
>
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is
> the property of Accelerite, a Persistent Systems business. It is intended
> only for the use of the individual or entity to which it is addressed. If
> you are not the intended recipient, you are not authorized to read, retain,
> copy, print, distribute or use this message. If you have received this
> communication in error, please notify the sender and delete all copies of
> this message. Accelerite, a Persistent Systems business does not accept any
> liability for virus infected mails.
>

RE: Hiding buttons based on role

Posted by Marty Godsey <ma...@gonsource.com>.
That would be great. I think adding the ability hide GUI elements based on role inside the GUI would be a great step.

Regards,
Marty Godsey

-----Original Message-----
From: Rashmi Dixit [mailto:rashmi_dixit@accelerite.com] 
Sent: Thursday, August 18, 2016 8:15 AM
To: dev@cloudstack.apache.org
Subject: RE: Hiding buttons based on role

Hi Marty,

We could add an "actionPreFilter" for "actions" defined in the widgets which will filter out the buttons based on role.

There are preFilters already implemented for fields in a listView - we need to follow the same principle. We need to check for this filter where the buttons are built in the listView (look for "if (listViewData.actions) {" in listView.js).

Hope this helps! 
Rashmi



-----Original Message-----
From: Marty Godsey [mailto:marty@gonsource.com]
Sent: Thursday, August 18, 2016 6:04 AM
To: dev@cloudstack.apache.org
Subject: RE: Hiding buttons based on role

Not elegant but will work. This is not a one off to a degree. It's for my own servers but I will have at least 10-20 management server across the country in different zones  but this allows me to "hide" some elements that won't be used until a more elegant way is created/available.

Thank you for the direction Will.

Regards,
Marty Godsey

-----Original Message-----
From: Will Stevens [mailto:williamstevens@gmail.com]
Sent: Wednesday, August 17, 2016 8:29 PM
To: dev@cloudstack.apache.org
Subject: RE: Hiding buttons based on role

If I was doing a one off solution for my own use case with a limited scope, I would do it he following.

Apply a CSS class to the <body> tag which corresponds to the role. Then I would use CSS to 'display:none' on the elements you want to turn off by referencing the body role class (and keep the permissions applied so if they unhide it won't work).

It is not an elegant solution, but it will work.

On Aug 17, 2016 8:19 PM, "Marty Godsey" <ma...@gonsource.com> wrote:

>

> Ok. Thank you.
>
> I think for the time being I will enable all the project APIs again 
> but
deny access to create a project.. this way at least he API errors on page load go away.
>
> This is something I think would be nice to have in the permissions 
> area
now since we have granular rules. A way to "turn off" certain areas of the GUI and/or ACS functionality.
>
> Regards,
> Marty Godsey
>
> -----Original Message-----
> From: Will Stevens [mailto:williamstevens@gmail.com]
> Sent: Wednesday, August 17, 2016 8:10 PM
> To: dev@cloudstack.apache.org
> Subject: RE: Hiding buttons based on role
>
> Yes. Most of the UI is built using huge json structures. These will 
> need
to be adapted to account for a user's role. I don't think there has been work done on that yet, but I could be wrong.
>
> @rohit, do you know if anyone has looked into this at all yet?
>
> On Aug 17, 2016 7:41 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
>
> > With that being said, we are now getting into the area of UI 
> > modification to hide the button huh?
> >
> > Regards,
> > Marty Godsey
> >
> > -----Original Message-----
> > From: Will Stevens [mailto:williamstevens@gmail.com]
> > Sent: Wednesday, August 17, 2016 7:23 PM
> > To: dev@cloudstack.apache.org
> > Subject: Re: Hiding buttons based on role
> >
> > My understanding is that the permissions can be set, but they 
> > currently do not modify the UI in any way. I believe what you are 
> > experiencing is the expected behavior.
> >
> > Cheers,
> >
> > Will
> >
> > On Aug 17, 2016 6:47 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
> >
> > > Is it possible to hide a button based upon a role? As an example I 
> > > want to hide and deny access to the projects tab. I can modify the 
> > > role access to the API but the button is still present. In fact I 
> > > get an API error that states I don't have access.
> > >
> > > Regards,
> > > Marty Godsey
> > >
> > >
> >



DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Accelerite, a Persistent Systems business. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Accelerite, a Persistent Systems business does not accept any liability for virus infected mails.

RE: Hiding buttons based on role

Posted by Rashmi Dixit <ra...@accelerite.com>.
Hi Marty,

We could add an "actionPreFilter" for "actions" defined in the widgets which will filter out the buttons based on role.

There are preFilters already implemented for fields in a listView - we need to follow the same principle. We need to check for this filter where the buttons are built in the listView (look for "if (listViewData.actions) {" in listView.js).

Hope this helps! 
Rashmi



-----Original Message-----
From: Marty Godsey [mailto:marty@gonsource.com] 
Sent: Thursday, August 18, 2016 6:04 AM
To: dev@cloudstack.apache.org
Subject: RE: Hiding buttons based on role

Not elegant but will work. This is not a one off to a degree. It's for my own servers but I will have at least 10-20 management server across the country in different zones  but this allows me to "hide" some elements that won't be used until a more elegant way is created/available.

Thank you for the direction Will.

Regards,
Marty Godsey

-----Original Message-----
From: Will Stevens [mailto:williamstevens@gmail.com]
Sent: Wednesday, August 17, 2016 8:29 PM
To: dev@cloudstack.apache.org
Subject: RE: Hiding buttons based on role

If I was doing a one off solution for my own use case with a limited scope, I would do it he following.

Apply a CSS class to the <body> tag which corresponds to the role. Then I would use CSS to 'display:none' on the elements you want to turn off by referencing the body role class (and keep the permissions applied so if they unhide it won't work).

It is not an elegant solution, but it will work.

On Aug 17, 2016 8:19 PM, "Marty Godsey" <ma...@gonsource.com> wrote:

>

> Ok. Thank you.
>
> I think for the time being I will enable all the project APIs again 
> but
deny access to create a project.. this way at least he API errors on page load go away.
>
> This is something I think would be nice to have in the permissions 
> area
now since we have granular rules. A way to "turn off" certain areas of the GUI and/or ACS functionality.
>
> Regards,
> Marty Godsey
>
> -----Original Message-----
> From: Will Stevens [mailto:williamstevens@gmail.com]
> Sent: Wednesday, August 17, 2016 8:10 PM
> To: dev@cloudstack.apache.org
> Subject: RE: Hiding buttons based on role
>
> Yes. Most of the UI is built using huge json structures. These will 
> need
to be adapted to account for a user's role. I don't think there has been work done on that yet, but I could be wrong.
>
> @rohit, do you know if anyone has looked into this at all yet?
>
> On Aug 17, 2016 7:41 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
>
> > With that being said, we are now getting into the area of UI 
> > modification to hide the button huh?
> >
> > Regards,
> > Marty Godsey
> >
> > -----Original Message-----
> > From: Will Stevens [mailto:williamstevens@gmail.com]
> > Sent: Wednesday, August 17, 2016 7:23 PM
> > To: dev@cloudstack.apache.org
> > Subject: Re: Hiding buttons based on role
> >
> > My understanding is that the permissions can be set, but they 
> > currently do not modify the UI in any way. I believe what you are 
> > experiencing is the expected behavior.
> >
> > Cheers,
> >
> > Will
> >
> > On Aug 17, 2016 6:47 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
> >
> > > Is it possible to hide a button based upon a role? As an example I 
> > > want to hide and deny access to the projects tab. I can modify the 
> > > role access to the API but the button is still present. In fact I 
> > > get an API error that states I don't have access.
> > >
> > > Regards,
> > > Marty Godsey
> > >
> > >
> >



DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Accelerite, a Persistent Systems business. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Accelerite, a Persistent Systems business does not accept any liability for virus infected mails.

Re: Hiding buttons based on role

Posted by Rohit Yadav <ro...@shapeblue.com>.
Hi Marty, Will,


I've heard about such a request before. Due to our legacy UI, there is no way to use api-discovery for a logged in user (based on their role etc.) to enable/disable UI elements such as buttons, views etc. Though a specific element may be hidden or displayed based on custom logic if the scope of it is rather small.


Regards.

________________________________
From: Will Stevens <wi...@gmail.com>
Sent: 18 August 2016 06:19:24
To: dev@cloudstack.apache.org
Subject: RE: Hiding buttons based on role

Right. By one off, I mean, I don't expect the entire community to adopt
this approach.

The one thing to pay attention to with this approach is that every time you
change a roles permissions, you have to adapt and redeploy the CSS to
reflect the permission change. I don't remember if you have to rebuild to
pick up a new CSS file (I sure hope not).  You could put the css in an
object store (like s3) and reference it in ACS, then update the CORS
settings to 'allow origin X' and serve it from a central location. This way
if you have multiple installs of ACS that will have the same permissions
you can update the visibility on all in a single place.

How you want to manage it will depend on how you are configuring and
managing your ACS setups, but you the idea.

On Aug 17, 2016 8:34 PM, "Marty Godsey" <ma...@gonsource.com> wrote:

> Not elegant but will work. This is not a one off to a degree. It's for my
> own servers but I will have at least 10-20 management server across the
> country in different zones  but this allows me to "hide" some elements that
> won't be used until a more elegant way is created/available.
>
> Thank you for the direction Will.
>
> Regards,
> Marty Godsey
>
> -----Original Message-----
> From: Will Stevens [mailto:williamstevens@gmail.com]
> Sent: Wednesday, August 17, 2016 8:29 PM
> To: dev@cloudstack.apache.org
> Subject: RE: Hiding buttons based on role
>
> If I was doing a one off solution for my own use case with a limited
> scope, I would do it he following.
>
> Apply a CSS class to the <body> tag which corresponds to the role. Then I
> would use CSS to 'display:none' on the elements you want to turn off by
> referencing the body role class (and keep the permissions applied so if
> they unhide it won't work).
>
> It is not an elegant solution, but it will work.
>
> On Aug 17, 2016 8:19 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
>
> >
>
> > Ok. Thank you.
> >
> > I think for the time being I will enable all the project APIs again
> > but
> deny access to create a project.. this way at least he API errors on page
> load go away.
> >
> > This is something I think would be nice to have in the permissions
> > area
> now since we have granular rules. A way to "turn off" certain areas of the
> GUI and/or ACS functionality.
> >
> > Regards,
> > Marty Godsey
> >
> > -----Original Message-----
> > From: Will Stevens [mailto:williamstevens@gmail.com]
> > Sent: Wednesday, August 17, 2016 8:10 PM
> > To: dev@cloudstack.apache.org
> > Subject: RE: Hiding buttons based on role
> >
> > Yes. Most of the UI is built using huge json structures. These will
> > need
> to be adapted to account for a user's role. I don't think there has been
> work done on that yet, but I could be wrong.
> >
> > @rohit, do you know if anyone has looked into this at all yet?
> >
> > On Aug 17, 2016 7:41 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
> >
> > > With that being said, we are now getting into the area of UI
> > > modification to hide the button huh?
> > >
> > > Regards,
> > > Marty Godsey
> > >
> > > -----Original Message-----
> > > From: Will Stevens [mailto:williamstevens@gmail.com]
> > > Sent: Wednesday, August 17, 2016 7:23 PM
> > > To: dev@cloudstack.apache.org
> > > Subject: Re: Hiding buttons based on role
> > >
> > > My understanding is that the permissions can be set, but they
> > > currently do not modify the UI in any way. I believe what you are
> > > experiencing is the expected behavior.
> > >
> > > Cheers,
> > >
> > > Will
> > >
> > > On Aug 17, 2016 6:47 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
> > >
> > > > Is it possible to hide a button based upon a role? As an example I
> > > > want to hide and deny access to the projects tab. I can modify the
> > > > role access to the API but the button is still present. In fact I
> > > > get an API error that states I don't have access.
> > > >
> > > > Regards,
> > > > Marty Godsey
> > > >
> > > >
> > >
>

rohit.yadav@shapeblue.com 
www.shapeblue.com
53 Chandos Place, Covent Garden, London  WC2N 4HSUK
@shapeblue
  
 


RE: Hiding buttons based on role

Posted by Will Stevens <wi...@gmail.com>.
Right. By one off, I mean, I don't expect the entire community to adopt
this approach.

The one thing to pay attention to with this approach is that every time you
change a roles permissions, you have to adapt and redeploy the CSS to
reflect the permission change. I don't remember if you have to rebuild to
pick up a new CSS file (I sure hope not).  You could put the css in an
object store (like s3) and reference it in ACS, then update the CORS
settings to 'allow origin X' and serve it from a central location. This way
if you have multiple installs of ACS that will have the same permissions
you can update the visibility on all in a single place.

How you want to manage it will depend on how you are configuring and
managing your ACS setups, but you the idea.

On Aug 17, 2016 8:34 PM, "Marty Godsey" <ma...@gonsource.com> wrote:

> Not elegant but will work. This is not a one off to a degree. It's for my
> own servers but I will have at least 10-20 management server across the
> country in different zones  but this allows me to "hide" some elements that
> won't be used until a more elegant way is created/available.
>
> Thank you for the direction Will.
>
> Regards,
> Marty Godsey
>
> -----Original Message-----
> From: Will Stevens [mailto:williamstevens@gmail.com]
> Sent: Wednesday, August 17, 2016 8:29 PM
> To: dev@cloudstack.apache.org
> Subject: RE: Hiding buttons based on role
>
> If I was doing a one off solution for my own use case with a limited
> scope, I would do it he following.
>
> Apply a CSS class to the <body> tag which corresponds to the role. Then I
> would use CSS to 'display:none' on the elements you want to turn off by
> referencing the body role class (and keep the permissions applied so if
> they unhide it won't work).
>
> It is not an elegant solution, but it will work.
>
> On Aug 17, 2016 8:19 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
>
> >
>
> > Ok. Thank you.
> >
> > I think for the time being I will enable all the project APIs again
> > but
> deny access to create a project.. this way at least he API errors on page
> load go away.
> >
> > This is something I think would be nice to have in the permissions
> > area
> now since we have granular rules. A way to "turn off" certain areas of the
> GUI and/or ACS functionality.
> >
> > Regards,
> > Marty Godsey
> >
> > -----Original Message-----
> > From: Will Stevens [mailto:williamstevens@gmail.com]
> > Sent: Wednesday, August 17, 2016 8:10 PM
> > To: dev@cloudstack.apache.org
> > Subject: RE: Hiding buttons based on role
> >
> > Yes. Most of the UI is built using huge json structures. These will
> > need
> to be adapted to account for a user's role. I don't think there has been
> work done on that yet, but I could be wrong.
> >
> > @rohit, do you know if anyone has looked into this at all yet?
> >
> > On Aug 17, 2016 7:41 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
> >
> > > With that being said, we are now getting into the area of UI
> > > modification to hide the button huh?
> > >
> > > Regards,
> > > Marty Godsey
> > >
> > > -----Original Message-----
> > > From: Will Stevens [mailto:williamstevens@gmail.com]
> > > Sent: Wednesday, August 17, 2016 7:23 PM
> > > To: dev@cloudstack.apache.org
> > > Subject: Re: Hiding buttons based on role
> > >
> > > My understanding is that the permissions can be set, but they
> > > currently do not modify the UI in any way. I believe what you are
> > > experiencing is the expected behavior.
> > >
> > > Cheers,
> > >
> > > Will
> > >
> > > On Aug 17, 2016 6:47 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
> > >
> > > > Is it possible to hide a button based upon a role? As an example I
> > > > want to hide and deny access to the projects tab. I can modify the
> > > > role access to the API but the button is still present. In fact I
> > > > get an API error that states I don't have access.
> > > >
> > > > Regards,
> > > > Marty Godsey
> > > >
> > > >
> > >
>

RE: Hiding buttons based on role

Posted by Marty Godsey <ma...@gonsource.com>.
Not elegant but will work. This is not a one off to a degree. It's for my own servers but I will have at least 10-20 management server across the country in different zones  but this allows me to "hide" some elements that won't be used until a more elegant way is created/available.

Thank you for the direction Will.

Regards,
Marty Godsey

-----Original Message-----
From: Will Stevens [mailto:williamstevens@gmail.com] 
Sent: Wednesday, August 17, 2016 8:29 PM
To: dev@cloudstack.apache.org
Subject: RE: Hiding buttons based on role

If I was doing a one off solution for my own use case with a limited scope, I would do it he following.

Apply a CSS class to the <body> tag which corresponds to the role. Then I would use CSS to 'display:none' on the elements you want to turn off by referencing the body role class (and keep the permissions applied so if they unhide it won't work).

It is not an elegant solution, but it will work.

On Aug 17, 2016 8:19 PM, "Marty Godsey" <ma...@gonsource.com> wrote:

>

> Ok. Thank you.
>
> I think for the time being I will enable all the project APIs again 
> but
deny access to create a project.. this way at least he API errors on page load go away.
>
> This is something I think would be nice to have in the permissions 
> area
now since we have granular rules. A way to "turn off" certain areas of the GUI and/or ACS functionality.
>
> Regards,
> Marty Godsey
>
> -----Original Message-----
> From: Will Stevens [mailto:williamstevens@gmail.com]
> Sent: Wednesday, August 17, 2016 8:10 PM
> To: dev@cloudstack.apache.org
> Subject: RE: Hiding buttons based on role
>
> Yes. Most of the UI is built using huge json structures. These will 
> need
to be adapted to account for a user's role. I don't think there has been work done on that yet, but I could be wrong.
>
> @rohit, do you know if anyone has looked into this at all yet?
>
> On Aug 17, 2016 7:41 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
>
> > With that being said, we are now getting into the area of UI 
> > modification to hide the button huh?
> >
> > Regards,
> > Marty Godsey
> >
> > -----Original Message-----
> > From: Will Stevens [mailto:williamstevens@gmail.com]
> > Sent: Wednesday, August 17, 2016 7:23 PM
> > To: dev@cloudstack.apache.org
> > Subject: Re: Hiding buttons based on role
> >
> > My understanding is that the permissions can be set, but they 
> > currently do not modify the UI in any way. I believe what you are 
> > experiencing is the expected behavior.
> >
> > Cheers,
> >
> > Will
> >
> > On Aug 17, 2016 6:47 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
> >
> > > Is it possible to hide a button based upon a role? As an example I 
> > > want to hide and deny access to the projects tab. I can modify the 
> > > role access to the API but the button is still present. In fact I 
> > > get an API error that states I don't have access.
> > >
> > > Regards,
> > > Marty Godsey
> > >
> > >
> >

RE: Hiding buttons based on role

Posted by Will Stevens <wi...@gmail.com>.
If I was doing a one off solution for my own use case with a limited scope,
I would do it he following.

Apply a CSS class to the <body> tag which corresponds to the role. Then I
would use CSS to 'display:none' on the elements you want to turn off by
referencing the body role class (and keep the permissions applied so if
they unhide it won't work).

It is not an elegant solution, but it will work.

On Aug 17, 2016 8:19 PM, "Marty Godsey" <ma...@gonsource.com> wrote:

>

> Ok. Thank you.
>
> I think for the time being I will enable all the project APIs again but
deny access to create a project.. this way at least he API errors on page
load go away.
>
> This is something I think would be nice to have in the permissions area
now since we have granular rules. A way to "turn off" certain areas of the
GUI and/or ACS functionality.
>
> Regards,
> Marty Godsey
>
> -----Original Message-----
> From: Will Stevens [mailto:williamstevens@gmail.com]
> Sent: Wednesday, August 17, 2016 8:10 PM
> To: dev@cloudstack.apache.org
> Subject: RE: Hiding buttons based on role
>
> Yes. Most of the UI is built using huge json structures. These will need
to be adapted to account for a user's role. I don't think there has been
work done on that yet, but I could be wrong.
>
> @rohit, do you know if anyone has looked into this at all yet?
>
> On Aug 17, 2016 7:41 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
>
> > With that being said, we are now getting into the area of UI
> > modification to hide the button huh?
> >
> > Regards,
> > Marty Godsey
> >
> > -----Original Message-----
> > From: Will Stevens [mailto:williamstevens@gmail.com]
> > Sent: Wednesday, August 17, 2016 7:23 PM
> > To: dev@cloudstack.apache.org
> > Subject: Re: Hiding buttons based on role
> >
> > My understanding is that the permissions can be set, but they
> > currently do not modify the UI in any way. I believe what you are
> > experiencing is the expected behavior.
> >
> > Cheers,
> >
> > Will
> >
> > On Aug 17, 2016 6:47 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
> >
> > > Is it possible to hide a button based upon a role? As an example I
> > > want to hide and deny access to the projects tab. I can modify the
> > > role access to the API but the button is still present. In fact I
> > > get an API error that states I don't have access.
> > >
> > > Regards,
> > > Marty Godsey
> > >
> > >
> >

RE: Hiding buttons based on role

Posted by Marty Godsey <ma...@gonsource.com>.
Ok. Thank you.

I think for the time being I will enable all the project APIs again but deny access to create a project.. this way at least he API errors on page load go away.

This is something I think would be nice to have in the permissions area now since we have granular rules. A way to "turn off" certain areas of the GUI and/or ACS functionality.

Regards,
Marty Godsey

-----Original Message-----
From: Will Stevens [mailto:williamstevens@gmail.com] 
Sent: Wednesday, August 17, 2016 8:10 PM
To: dev@cloudstack.apache.org
Subject: RE: Hiding buttons based on role

Yes. Most of the UI is built using huge json structures. These will need to be adapted to account for a user's role. I don't think there has been work done on that yet, but I could be wrong.

@rohit, do you know if anyone has looked into this at all yet?

On Aug 17, 2016 7:41 PM, "Marty Godsey" <ma...@gonsource.com> wrote:

> With that being said, we are now getting into the area of UI 
> modification to hide the button huh?
>
> Regards,
> Marty Godsey
>
> -----Original Message-----
> From: Will Stevens [mailto:williamstevens@gmail.com]
> Sent: Wednesday, August 17, 2016 7:23 PM
> To: dev@cloudstack.apache.org
> Subject: Re: Hiding buttons based on role
>
> My understanding is that the permissions can be set, but they 
> currently do not modify the UI in any way. I believe what you are 
> experiencing is the expected behavior.
>
> Cheers,
>
> Will
>
> On Aug 17, 2016 6:47 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
>
> > Is it possible to hide a button based upon a role? As an example I 
> > want to hide and deny access to the projects tab. I can modify the 
> > role access to the API but the button is still present. In fact I 
> > get an API error that states I don't have access.
> >
> > Regards,
> > Marty Godsey
> >
> >
>

RE: Hiding buttons based on role

Posted by Will Stevens <wi...@gmail.com>.
Yes. Most of the UI is built using huge json structures. These will need to
be adapted to account for a user's role. I don't think there has been work
done on that yet, but I could be wrong.

@rohit, do you know if anyone has looked into this at all yet?

On Aug 17, 2016 7:41 PM, "Marty Godsey" <ma...@gonsource.com> wrote:

> With that being said, we are now getting into the area of UI modification
> to hide the button huh?
>
> Regards,
> Marty Godsey
>
> -----Original Message-----
> From: Will Stevens [mailto:williamstevens@gmail.com]
> Sent: Wednesday, August 17, 2016 7:23 PM
> To: dev@cloudstack.apache.org
> Subject: Re: Hiding buttons based on role
>
> My understanding is that the permissions can be set, but they currently do
> not modify the UI in any way. I believe what you are experiencing is the
> expected behavior.
>
> Cheers,
>
> Will
>
> On Aug 17, 2016 6:47 PM, "Marty Godsey" <ma...@gonsource.com> wrote:
>
> > Is it possible to hide a button based upon a role? As an example I
> > want to hide and deny access to the projects tab. I can modify the
> > role access to the API but the button is still present. In fact I get
> > an API error that states I don't have access.
> >
> > Regards,
> > Marty Godsey
> >
> >
>

RE: Hiding buttons based on role

Posted by Marty Godsey <ma...@gonsource.com>.
With that being said, we are now getting into the area of UI modification to hide the button huh?

Regards,
Marty Godsey

-----Original Message-----
From: Will Stevens [mailto:williamstevens@gmail.com] 
Sent: Wednesday, August 17, 2016 7:23 PM
To: dev@cloudstack.apache.org
Subject: Re: Hiding buttons based on role

My understanding is that the permissions can be set, but they currently do not modify the UI in any way. I believe what you are experiencing is the expected behavior.

Cheers,

Will

On Aug 17, 2016 6:47 PM, "Marty Godsey" <ma...@gonsource.com> wrote:

> Is it possible to hide a button based upon a role? As an example I 
> want to hide and deny access to the projects tab. I can modify the 
> role access to the API but the button is still present. In fact I get 
> an API error that states I don't have access.
>
> Regards,
> Marty Godsey
>
>

Re: Hiding buttons based on role

Posted by Will Stevens <wi...@gmail.com>.
My understanding is that the permissions can be set, but they currently do
not modify the UI in any way. I believe what you are experiencing is the
expected behavior.

Cheers,

Will

On Aug 17, 2016 6:47 PM, "Marty Godsey" <ma...@gonsource.com> wrote:

> Is it possible to hide a button based upon a role? As an example I want to
> hide and deny access to the projects tab. I can modify the role access to
> the API but the button is still present. In fact I get an API error that
> states I don't have access.
>
> Regards,
> Marty Godsey
>
>