You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Warren <wa...@clarksnutrition.com> on 2008/02/19 20:47:21 UTC
Wicket-security wish list
Maurice,
I was thinking about this "Access Denied" message problem I have been
working on and thought up some features that might be useful in future
releases. It would be nice to be able to configure "Access Denied" messages
directly into the hive like this:
grant principal com.scanman.security.authorization.ScanManPrincipal "ScanMan
Receiving" "Principal Access Denied Message Here"
{
permission ${ComponentPermission} "${RecvMenu}", "inherit, render, enable",
"Permission Access Denied Message Here";
};
grant principal com.scanman.security.authorization.ScanManPrincipal "ScanMan
Ordering" "Principal Access Denied Message Here"
{
permission ${ComponentPermission} "${OrderMenu}", "inherit, render,
enable", "Permission Access Denied Message Here";
};
I believe you are following some kind of standard for how the hive is
set-up, so I am not sure this would work. But anyway, you could then set-up
the configuration of how these messages were used in the
SwarmWebApplication. For Example, put them into the error queue, or take
advantage of message resources, message keys and localization and so on. I
ended up putting these messages into the error queue from MySwarmStrategy
and it works great.
I can't imagine that a feature like this would not be of some value to other
users. My app has a lot of different levels of security and permissions that
the Administrative user can configure within a separate "Point of Sale" app.
Messages of this sort are valuable to a user so that security levels and
permissions can be tweaked to best suit a companies policies. A simple
"Access Denied" message gives little clue as to why access was denied.
That's my two cents. Thanks for all the help you have given me. Your project
surely deserves a lot of credit.
Thanks,
Warren Bell
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: BaseWicketTester.isVisible() doesn't check Component.isRenderAllowed()
Posted by Igor Vaynberg <ig...@gmail.com>.
yes, add to jira please
-igor
On Thu, Feb 21, 2008 at 5:57 AM, Wang, Yuesong <yw...@fedcsc.com> wrote:
> BaseWicketTester.isVisible() only checks Component.isVisible(), not
> Component.isRenderAllowed(). So for a component whose RENDER action is
> disabled through role based authorization strategy,
> BaseWicketTester.isVisible() still returns true.
> BaseWicketTester.isInvisible() works correctly by using
> BaseWicketTester.getComponentFromLastRenderedPage() which checks both
> Component.isVisible() and isRenderAllowed().
>
> Should I add this to JIRA?
>
> Yuesong
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
BaseWicketTester.isVisible() doesn't check Component.isRenderAllowed()
Posted by "Wang, Yuesong" <yw...@fedcsc.com>.
BaseWicketTester.isVisible() only checks Component.isVisible(), not
Component.isRenderAllowed(). So for a component whose RENDER action is
disabled through role based authorization strategy,
BaseWicketTester.isVisible() still returns true.
BaseWicketTester.isInvisible() works correctly by using
BaseWicketTester.getComponentFromLastRenderedPage() which checks both
Component.isVisible() and isRenderAllowed().
Should I add this to JIRA?
Yuesong
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Tab switching events?
Posted by Igor Vaynberg <ig...@gmail.com>.
On Wed, Feb 20, 2008 at 10:51 AM, Michael Mehrle <mi...@ask.com> wrote:
> I have a TabbedPanel (a) that contains two panels which in turn each
> contain one TabbedPanel (b) and (c). When I switch a tab in (b) or (c) I
> need to retain the tab selection of (a) in their link logic. I am
> currently overriding newLink() for all panels using
> IndexedParamUrlCodingStrategy.
>
> One approach I am considering is to capture the event when (a) is being
> switched to another tab, catching its tab index and putting it into an
> instance variable of the enclosing page.
>
> Questions:
>
> 1) How do I catch that tab switching event?
you provide the ITab implementaton. your event is when ITab.getPanel()
is called..
> 2) Does anyone know a better way of correlating link generation logic
> with nested tabbed panels?
yes. use normal links, that way everything is done automatically :)
-igor
>
> Thanks in advance!
>
> Michael
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Tab switching events?
Posted by Michael Mehrle <mi...@ask.com>.
I have a TabbedPanel (a) that contains two panels which in turn each
contain one TabbedPanel (b) and (c). When I switch a tab in (b) or (c) I
need to retain the tab selection of (a) in their link logic. I am
currently overriding newLink() for all panels using
IndexedParamUrlCodingStrategy.
One approach I am considering is to capture the event when (a) is being
switched to another tab, catching its tab index and putting it into an
instance variable of the enclosing page.
Questions:
1) How do I catch that tab switching event?
2) Does anyone know a better way of correlating link generation logic
with nested tabbed panels?
Thanks in advance!
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: Wicket-security wish list
Posted by Warren <wa...@clarksnutrition.com>.
Yes, this would work if you did not need to give the user any type of
indication why they can not go to that page. My app is very flexible in that
an administrator can adjust security settings based on their company's
policies. Say for instance, I have a whole ordering section of my app where
a user can go and place orders for product. A user in the user group
Cashiers can not order in one company but can in another. The Administrator
would simply add or exclude the ordering permission for the Cashier's group
based on what the companies policies are. The Administrator does this in
another stand alone app. My app reads these permissions from the other app's
database and converts them to Principals and then adds those Principals to
the Subject thru a loop. One permission in the other app will equal one or
more permissions in one Principal in my app.
DefaultSubject subject = new DefaultSubject();
for (Map<String, String> securityLevel :
user.getUserGroup().getSecurityLevels())
{
subject.addPrincipal(new ScanManPrincipal(securityLevel.get("level")));
}
return subject;
You may wonder, why doesn't the cashier simply say "Hey I can't order". Well
in that situation maybe, but in other situations it's not so clear why a
user was denied access, and in my experience, the users of my app are not
the brightest. Now a permission like "Show Cost", you would just show or not
show the cost with no explanation.
> -----Original Message-----
> From: Maurice Marrink [mailto:marrink@gmail.com]
> Sent: Wednesday, February 20, 2008 8:28 AM
> To: users@wicket.apache.org
> Subject: Re: Wicket-security wish list
>
>
> Johan is correct, you should use SecurePageLinks or other Links that
> are protected to prevent users from ever seeing or clicking the link.
>
> Maurice
>
> On Feb 20, 2008 5:21 PM, Johan Compagner <jc...@gmail.com> wrote:
> > Why do you get access denied pages a lot in your app?
> > I would say a user shouldnt be abe to click on that link in the first
> > place. Only maybe when he tampers with it. But if you have session
> > pages that that shouldnt be a problem. (only bookmakrable pages where
> > a user has to first login for)
> >
> >
> > On 2/19/08, Warren <wa...@clarksnutrition.com> wrote:
> > > Maurice,
> > >
> > > I was thinking about this "Access Denied" message problem I have been
> > > working on and thought up some features that might be useful in future
> > > releases. It would be nice to be able to configure "Access
> Denied" messages
> > > directly into the hive like this:
> > >
> > > grant principal
> com.scanman.security.authorization.ScanManPrincipal "ScanMan
> > > Receiving" "Principal Access Denied Message Here"
> > > {
> > > permission ${ComponentPermission} "${RecvMenu}",
> "inherit, render, enable",
> > > "Permission Access Denied Message Here";
> > > };
> > > grant principal
> com.scanman.security.authorization.ScanManPrincipal "ScanMan
> > > Ordering" "Principal Access Denied Message Here"
> > > {
> > > permission ${ComponentPermission} "${OrderMenu}",
> "inherit, render,
> > > enable", "Permission Access Denied Message Here";
> > > };
> > >
> > > I believe you are following some kind of standard for how the hive is
> > > set-up, so I am not sure this would work. But anyway, you
> could then set-up
> > > the configuration of how these messages were used in the
> > > SwarmWebApplication. For Example, put them into the error
> queue, or take
> > > advantage of message resources, message keys and localization
> and so on. I
> > > ended up putting these messages into the error queue from
> MySwarmStrategy
> > > and it works great.
> > >
> > > I can't imagine that a feature like this would not be of some
> value to other
> > > users. My app has a lot of different levels of security and
> permissions that
> > > the Administrative user can configure within a separate
> "Point of Sale" app.
> > > Messages of this sort are valuable to a user so that security
> levels and
> > > permissions can be tweaked to best suit a companies policies. A simple
> > > "Access Denied" message gives little clue as to why access was denied.
> > >
> > > That's my two cents. Thanks for all the help you have given
> me. Your project
> > > surely deserves a lot of credit.
> > >
> > > Thanks,
> > >
> > > Warren Bell
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket-security wish list
Posted by Maurice Marrink <ma...@gmail.com>.
Johan is correct, you should use SecurePageLinks or other Links that
are protected to prevent users from ever seeing or clicking the link.
Maurice
On Feb 20, 2008 5:21 PM, Johan Compagner <jc...@gmail.com> wrote:
> Why do you get access denied pages a lot in your app?
> I would say a user shouldnt be abe to click on that link in the first
> place. Only maybe when he tampers with it. But if you have session
> pages that that shouldnt be a problem. (only bookmakrable pages where
> a user has to first login for)
>
>
> On 2/19/08, Warren <wa...@clarksnutrition.com> wrote:
> > Maurice,
> >
> > I was thinking about this "Access Denied" message problem I have been
> > working on and thought up some features that might be useful in future
> > releases. It would be nice to be able to configure "Access Denied" messages
> > directly into the hive like this:
> >
> > grant principal com.scanman.security.authorization.ScanManPrincipal "ScanMan
> > Receiving" "Principal Access Denied Message Here"
> > {
> > permission ${ComponentPermission} "${RecvMenu}", "inherit, render, enable",
> > "Permission Access Denied Message Here";
> > };
> > grant principal com.scanman.security.authorization.ScanManPrincipal "ScanMan
> > Ordering" "Principal Access Denied Message Here"
> > {
> > permission ${ComponentPermission} "${OrderMenu}", "inherit, render,
> > enable", "Permission Access Denied Message Here";
> > };
> >
> > I believe you are following some kind of standard for how the hive is
> > set-up, so I am not sure this would work. But anyway, you could then set-up
> > the configuration of how these messages were used in the
> > SwarmWebApplication. For Example, put them into the error queue, or take
> > advantage of message resources, message keys and localization and so on. I
> > ended up putting these messages into the error queue from MySwarmStrategy
> > and it works great.
> >
> > I can't imagine that a feature like this would not be of some value to other
> > users. My app has a lot of different levels of security and permissions that
> > the Administrative user can configure within a separate "Point of Sale" app.
> > Messages of this sort are valuable to a user so that security levels and
> > permissions can be tweaked to best suit a companies policies. A simple
> > "Access Denied" message gives little clue as to why access was denied.
> >
> > That's my two cents. Thanks for all the help you have given me. Your project
> > surely deserves a lot of credit.
> >
> > Thanks,
> >
> > Warren Bell
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket-security wish list
Posted by Johan Compagner <jc...@gmail.com>.
Why do you get access denied pages a lot in your app?
I would say a user shouldnt be abe to click on that link in the first
place. Only maybe when he tampers with it. But if you have session
pages that that shouldnt be a problem. (only bookmakrable pages where
a user has to first login for)
On 2/19/08, Warren <wa...@clarksnutrition.com> wrote:
> Maurice,
>
> I was thinking about this "Access Denied" message problem I have been
> working on and thought up some features that might be useful in future
> releases. It would be nice to be able to configure "Access Denied" messages
> directly into the hive like this:
>
> grant principal com.scanman.security.authorization.ScanManPrincipal "ScanMan
> Receiving" "Principal Access Denied Message Here"
> {
> permission ${ComponentPermission} "${RecvMenu}", "inherit, render, enable",
> "Permission Access Denied Message Here";
> };
> grant principal com.scanman.security.authorization.ScanManPrincipal "ScanMan
> Ordering" "Principal Access Denied Message Here"
> {
> permission ${ComponentPermission} "${OrderMenu}", "inherit, render,
> enable", "Permission Access Denied Message Here";
> };
>
> I believe you are following some kind of standard for how the hive is
> set-up, so I am not sure this would work. But anyway, you could then set-up
> the configuration of how these messages were used in the
> SwarmWebApplication. For Example, put them into the error queue, or take
> advantage of message resources, message keys and localization and so on. I
> ended up putting these messages into the error queue from MySwarmStrategy
> and it works great.
>
> I can't imagine that a feature like this would not be of some value to other
> users. My app has a lot of different levels of security and permissions that
> the Administrative user can configure within a separate "Point of Sale" app.
> Messages of this sort are valuable to a user so that security levels and
> permissions can be tweaked to best suit a companies policies. A simple
> "Access Denied" message gives little clue as to why access was denied.
>
> That's my two cents. Thanks for all the help you have given me. Your project
> surely deserves a lot of credit.
>
> Thanks,
>
> Warren Bell
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket-security wish list
Posted by Maurice Marrink <ma...@gmail.com>.
You don't use implies yourself. the framework will use it for you.
all you have to do is implement the method.
For example our implies looks like this (modified for readability)
public boolean implies(Subject subject)
{
if (subject == null)
return false;
String myName = getName();
for (Principal principal : (Set<Principal>) subject.getPrincipals())
{
//each RechtenSet as our principals are called has a list of other
principals it implies and a list of principals that imply this one
if (myName.equals(principal.getName())
|| (principal instanceof RechtenSet && ((RechtenSet)
principal).implies(this)))
{
return true;
}
}
return false;
}
//check if another principal is implied
public boolean implies(RechtenSet rechtenSet)
{
//because the list of implied principals is searched recursively and
may contain loops we use a set to store principals we have already
visited
return internalImplies(rechtenSet, new HashSet<RechtenSet>());
}
private boolean internalImplies(RechtenSet rechtenSet, Set<RechtenSet> tried)
{
//implies is the list of principals this principal implies
if (rechtenSet == null || implies == null || implies.isEmpty())
{
tried.add(this);
return false;
}
if (!tried.add(this))
return false; // we already tried this principal
for (RechtenSet set : implies)
{
if (set.getName().equals(rechtenSet.getName()))
return true;
if (set.internalImplies(rechtenSet, tried))
return true;
}
return false;
}
We store our principals in a database so we can preserve and easily
modify the imply lists. Not to mention attach them easily to a user :)
Maurice
On Feb 20, 2008 1:40 AM, Warren <wa...@clarksnutrition.com> wrote:
> Where am I using Principal.implies(Subject subject); and how? I add the
> Principals to my Subject when I authenticate my user, is it here or am I
> setting this up in my app or in my policy file? It is getting clearer how
> things are working. I have always created my own security implementation, I
> have not had any experience with anybody else's.
>
> > -----Original Message-----
> > From: Maurice Marrink [mailto:marrink@gmail.com]
> > Sent: Tuesday, February 19, 2008 2:27 PM
>
> > To: users@wicket.apache.orglses
> > Subject: Re: Wicket-security wish list
> >
> >
> > On Feb 19, 2008 10:39 PM, Warren <wa...@clarksnutrition.com> wrote:
> > > Maurice,
> > >
> > > Session.error() is how I ended up solving my problem. But, I
> > formatted the
> > > message in my session and then ended up calling error(...), that way
> > > SwarmStrategy was just returning the denied Principals. I did
> > not get as far
> > > as placing the message in a Properties file. I was not sure how to
> > > accommodate multiple denied Principals. As far as the multiple
> > principals in
> > > my app, I simply formatted my message like this:
> > >
> > > Users in User Group XXX do not have Access to "Access Denied
> > Principal 1"
> > > and "Access Denied Principal 2" ...
> >
> > Ok good to know.
> >
> > >
> > > I know that this can get a little verbose, but I am trying to set up my
> > > policy file so that any one permission does not end up in too
> > many different
> > > Principals. This will probably be an issue when using the
> > "inherit" action
> > > though.
> >
> > Using the inherit action has noting to do with how many principals are
> > linked to a permission.
> > Currently inherit action is primarily intended for the following
> > situation:
> > A page has both secure and normal components, the secure components
> > allow for editing of the modelobject of the page (for the sake of this
> > example i will assume they are textfields).
> > All components should always be visible but only editable if
> > sufficient permissions are granted. The policy would look something
> > like this:
> > grant principal "foo.read"
> > {
> > permission ${ComponentPermission} "org.MyPage", "inherit, render";
> > // to allow all components to be rendered
> > //using only render would require separate render permissions for each
> > component like so
> > //permission ${ComponentPermission} "org.MyPage:secureTextField1",
> > "render"; //etc for each secure component
> >
> > //assuming we have 1 or more links pointing to our page we also need
> > the following permission
> > permission ${ComponentPermission} "org.MyPage", "enable";
> > //note the absence of the inherit permission compared to the next
> > principal
> > //by not using inherit the enable action is only granted to the page
> > itself not to any of the secure components it contains
> > };
> > grant principal "foo.write"
> > {
> > permission ${ComponentPermission} "org.MyPage", "inherit, enable";
> > //to allow the user to use all the secure textfields on the page
> > }
> >
> > If you want to prevent permissions to be linked to to many principals
> > you should use Principal.implies(Subject subject);
> > The above example works without this implies because the "inherit,
> > enable" actions already imply the "inherit, render" actions for the
> > same component(s).
> > In the following example however that is not going to work:
> > Say we have a display page and an edit page, in this example it does
> > not matter if the edit page contains secure components or not because
> > the entire page is only visible if you have sufficient permissions.
> > grant principal "foo.read"
> > {
> > permission ${ComponentPermission} "org.MyDisplayPage", "inherit, render";
> > // still using inherit here out of habbit
> >
> > //assuming we have 1 or more links pointing to our display page we
> > also need the following permission
> > permission ${ComponentPermission} "org.MyDisplayPage", "enable";
> > };
> > grant principal "foo.write"
> > {
> > permission ${ComponentPermission} "org.MyEditPage", "inherit, render";
> > //assuming we only have normal textfields and stuff on the page
> >
> > //the display page probably has a securepagelink pointing to our edit
> > page so we need to grant permission for that
> > permission ${ComponentPermission} "org.MyRenderPage", "enable";
> > }
> > We could solve the above example 2 ways:
> > - the subject would need to have both foo.read and foo.write for him
> > to access the edit page through the edit button on the display page
> > -or we use principal.implies to specify that if the user only has
> > foo.write we can safely assume he also (should) have foo.read
> >
> > What happens in swarm is this:
> > 1 user tries to go to display page
> > 2 check render permission for display page
> > 3 detects none of the principals from the subject have this permission
> > (remember or subject only has foo.write)
> > 4 check each of the principals that contain the permission (as
> > specified in the hive) if they imply the subject
> > 5 foo.read principal detects the subject has the foo.write principal
> > and signals that the permission is granted
> > 6 wicket renders page
> >
> > The way we handle principal.implies in our application is by letting
> > our principal have a doubly linked list of both principals it implies
> > and principals it is implied by, the check to see if the subject has
> > another principal it is implied by is then easy.
> >
> > phew, this mail certainly got a lot longer than i intended and might
> > haven gotten a bit off-topic but i got the feeling some things were
> > not quite crystal clear :)
> >
> > Maurice
> > >
> > >
> > > > -----Original Message-----
> > > > From: Maurice Marrink [mailto:marrink@gmail.com]
> > > > Sent: Tuesday, February 19, 2008 1:27 PM
> > > > To: users@wicket.apache.org
> > > > Subject: Re: Wicket-security wish list
> > > >
> > > >
> > > > Thanks,
> > > >
> > > > Glad i could help.
> > > >
> > > > I like the idea of custom error messages but i doubt i will make them
> > > > configurable in the policy file, mainly because i would like to follow
> > > > the jaas policy format as close as possible and because a permission
> > > > can be part of multiple principals: what would we do then display the
> > > > message from each principal?
> > > > I am thinking more in the lines of using Session.error() to display
> > > > localized messages in the properties files currently used by wicket.
> > > > But I will have to think about this. Thanks for the suggestion.
> > > > I have created a jira issue so i won't forget it :)
> > > > http://wicketstuff.org/jira/browse/WSSWARM-6
> > > >
> > > > Maurice
> > > >
> > > > On Feb 19, 2008 8:47 PM, Warren <wa...@clarksnutrition.com> wrote:
> > > > > Maurice,
> > > > >
> > > > > I was thinking about this "Access Denied" message problem I
> > have been
> > > > > working on and thought up some features that might be
> > useful in future
> > > > > releases. It would be nice to be able to configure "Access
> > > > Denied" messages
> > > > > directly into the hive like this:
> > > > >
> > > > > grant principal
> > > > com.scanman.security.authorization.ScanManPrincipal "ScanMan
> > > > > Receiving" "Principal Access Denied Message Here"
> > > > > {
> > > > > permission ${ComponentPermission} "${RecvMenu}",
> > > > "inherit, render, enable",
> > > > > "Permission Access Denied Message Here";
> > > > > };
> > > > > grant principal
> > > > com.scanman.security.authorization.ScanManPrincipal "ScanMan
> > > > > Ordering" "Principal Access Denied Message Here"
> > > > > {
> > > > > permission ${ComponentPermission} "${OrderMenu}",
> > > > "inherit, render,
> > > > > enable", "Permission Access Denied Message Here";
> > > > > };
> > > > >
> > > > > I believe you are following some kind of standard for how
> > the hive is
> > > > > set-up, so I am not sure this would work. But anyway, you could
> > > > then set-up
> > > > > the configuration of how these messages were used in the
> > > > > SwarmWebApplication. For Example, put them into the error
> > queue, or take
> > > > > advantage of message resources, message keys and localization
> > > > and so on. I
> > > > > ended up putting these messages into the error queue from
> > > > MySwarmStrategy
> > > > > and it works great.
> > > > >
> > > > > I can't imagine that a feature like this would not be of some
> > > > value to other
> > > > > users. My app has a lot of different levels of security and
> > > > permissions that
> > > > > the Administrative user can configure within a separate "Point
> > > > of Sale" app.
> > > > > Messages of this sort are valuable to a user so that
> > security levels and
> > > > > permissions can be tweaked to best suit a companies
> > policies. A simple
> > > > > "Access Denied" message gives little clue as to why access
> > was denied.
> > > > >
> > > > > That's my two cents. Thanks for all the help you have given me.
> > > > Your project
> > > > > surely deserves a lot of credit.
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Warren Bell
> > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > > >
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: Wicket-security wish list
Posted by Warren <wa...@clarksnutrition.com>.
Where am I using Principal.implies(Subject subject); and how? I add the
Principals to my Subject when I authenticate my user, is it here or am I
setting this up in my app or in my policy file? It is getting clearer how
things are working. I have always created my own security implementation, I
have not had any experience with anybody else's.
> -----Original Message-----
> From: Maurice Marrink [mailto:marrink@gmail.com]
> Sent: Tuesday, February 19, 2008 2:27 PM
> To: users@wicket.apache.orglses
> Subject: Re: Wicket-security wish list
>
>
> On Feb 19, 2008 10:39 PM, Warren <wa...@clarksnutrition.com> wrote:
> > Maurice,
> >
> > Session.error() is how I ended up solving my problem. But, I
> formatted the
> > message in my session and then ended up calling error(...), that way
> > SwarmStrategy was just returning the denied Principals. I did
> not get as far
> > as placing the message in a Properties file. I was not sure how to
> > accommodate multiple denied Principals. As far as the multiple
> principals in
> > my app, I simply formatted my message like this:
> >
> > Users in User Group XXX do not have Access to "Access Denied
> Principal 1"
> > and "Access Denied Principal 2" ...
>
> Ok good to know.
>
> >
> > I know that this can get a little verbose, but I am trying to set up my
> > policy file so that any one permission does not end up in too
> many different
> > Principals. This will probably be an issue when using the
> "inherit" action
> > though.
>
> Using the inherit action has noting to do with how many principals are
> linked to a permission.
> Currently inherit action is primarily intended for the following
> situation:
> A page has both secure and normal components, the secure components
> allow for editing of the modelobject of the page (for the sake of this
> example i will assume they are textfields).
> All components should always be visible but only editable if
> sufficient permissions are granted. The policy would look something
> like this:
> grant principal "foo.read"
> {
> permission ${ComponentPermission} "org.MyPage", "inherit, render";
> // to allow all components to be rendered
> //using only render would require separate render permissions for each
> component like so
> //permission ${ComponentPermission} "org.MyPage:secureTextField1",
> "render"; //etc for each secure component
>
> //assuming we have 1 or more links pointing to our page we also need
> the following permission
> permission ${ComponentPermission} "org.MyPage", "enable";
> //note the absence of the inherit permission compared to the next
> principal
> //by not using inherit the enable action is only granted to the page
> itself not to any of the secure components it contains
> };
> grant principal "foo.write"
> {
> permission ${ComponentPermission} "org.MyPage", "inherit, enable";
> //to allow the user to use all the secure textfields on the page
> }
>
> If you want to prevent permissions to be linked to to many principals
> you should use Principal.implies(Subject subject);
> The above example works without this implies because the "inherit,
> enable" actions already imply the "inherit, render" actions for the
> same component(s).
> In the following example however that is not going to work:
> Say we have a display page and an edit page, in this example it does
> not matter if the edit page contains secure components or not because
> the entire page is only visible if you have sufficient permissions.
> grant principal "foo.read"
> {
> permission ${ComponentPermission} "org.MyDisplayPage", "inherit, render";
> // still using inherit here out of habbit
>
> //assuming we have 1 or more links pointing to our display page we
> also need the following permission
> permission ${ComponentPermission} "org.MyDisplayPage", "enable";
> };
> grant principal "foo.write"
> {
> permission ${ComponentPermission} "org.MyEditPage", "inherit, render";
> //assuming we only have normal textfields and stuff on the page
>
> //the display page probably has a securepagelink pointing to our edit
> page so we need to grant permission for that
> permission ${ComponentPermission} "org.MyRenderPage", "enable";
> }
> We could solve the above example 2 ways:
> - the subject would need to have both foo.read and foo.write for him
> to access the edit page through the edit button on the display page
> -or we use principal.implies to specify that if the user only has
> foo.write we can safely assume he also (should) have foo.read
>
> What happens in swarm is this:
> 1 user tries to go to display page
> 2 check render permission for display page
> 3 detects none of the principals from the subject have this permission
> (remember or subject only has foo.write)
> 4 check each of the principals that contain the permission (as
> specified in the hive) if they imply the subject
> 5 foo.read principal detects the subject has the foo.write principal
> and signals that the permission is granted
> 6 wicket renders page
>
> The way we handle principal.implies in our application is by letting
> our principal have a doubly linked list of both principals it implies
> and principals it is implied by, the check to see if the subject has
> another principal it is implied by is then easy.
>
> phew, this mail certainly got a lot longer than i intended and might
> haven gotten a bit off-topic but i got the feeling some things were
> not quite crystal clear :)
>
> Maurice
> >
> >
> > > -----Original Message-----
> > > From: Maurice Marrink [mailto:marrink@gmail.com]
> > > Sent: Tuesday, February 19, 2008 1:27 PM
> > > To: users@wicket.apache.org
> > > Subject: Re: Wicket-security wish list
> > >
> > >
> > > Thanks,
> > >
> > > Glad i could help.
> > >
> > > I like the idea of custom error messages but i doubt i will make them
> > > configurable in the policy file, mainly because i would like to follow
> > > the jaas policy format as close as possible and because a permission
> > > can be part of multiple principals: what would we do then display the
> > > message from each principal?
> > > I am thinking more in the lines of using Session.error() to display
> > > localized messages in the properties files currently used by wicket.
> > > But I will have to think about this. Thanks for the suggestion.
> > > I have created a jira issue so i won't forget it :)
> > > http://wicketstuff.org/jira/browse/WSSWARM-6
> > >
> > > Maurice
> > >
> > > On Feb 19, 2008 8:47 PM, Warren <wa...@clarksnutrition.com> wrote:
> > > > Maurice,
> > > >
> > > > I was thinking about this "Access Denied" message problem I
> have been
> > > > working on and thought up some features that might be
> useful in future
> > > > releases. It would be nice to be able to configure "Access
> > > Denied" messages
> > > > directly into the hive like this:
> > > >
> > > > grant principal
> > > com.scanman.security.authorization.ScanManPrincipal "ScanMan
> > > > Receiving" "Principal Access Denied Message Here"
> > > > {
> > > > permission ${ComponentPermission} "${RecvMenu}",
> > > "inherit, render, enable",
> > > > "Permission Access Denied Message Here";
> > > > };
> > > > grant principal
> > > com.scanman.security.authorization.ScanManPrincipal "ScanMan
> > > > Ordering" "Principal Access Denied Message Here"
> > > > {
> > > > permission ${ComponentPermission} "${OrderMenu}",
> > > "inherit, render,
> > > > enable", "Permission Access Denied Message Here";
> > > > };
> > > >
> > > > I believe you are following some kind of standard for how
> the hive is
> > > > set-up, so I am not sure this would work. But anyway, you could
> > > then set-up
> > > > the configuration of how these messages were used in the
> > > > SwarmWebApplication. For Example, put them into the error
> queue, or take
> > > > advantage of message resources, message keys and localization
> > > and so on. I
> > > > ended up putting these messages into the error queue from
> > > MySwarmStrategy
> > > > and it works great.
> > > >
> > > > I can't imagine that a feature like this would not be of some
> > > value to other
> > > > users. My app has a lot of different levels of security and
> > > permissions that
> > > > the Administrative user can configure within a separate "Point
> > > of Sale" app.
> > > > Messages of this sort are valuable to a user so that
> security levels and
> > > > permissions can be tweaked to best suit a companies
> policies. A simple
> > > > "Access Denied" message gives little clue as to why access
> was denied.
> > > >
> > > > That's my two cents. Thanks for all the help you have given me.
> > > Your project
> > > > surely deserves a lot of credit.
> > > >
> > > > Thanks,
> > > >
> > > > Warren Bell
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket-security wish list
Posted by Maurice Marrink <ma...@gmail.com>.
On Feb 19, 2008 10:39 PM, Warren <wa...@clarksnutrition.com> wrote:
> Maurice,
>
> Session.error() is how I ended up solving my problem. But, I formatted the
> message in my session and then ended up calling error(...), that way
> SwarmStrategy was just returning the denied Principals. I did not get as far
> as placing the message in a Properties file. I was not sure how to
> accommodate multiple denied Principals. As far as the multiple principals in
> my app, I simply formatted my message like this:
>
> Users in User Group XXX do not have Access to "Access Denied Principal 1"
> and "Access Denied Principal 2" ...
Ok good to know.
>
> I know that this can get a little verbose, but I am trying to set up my
> policy file so that any one permission does not end up in too many different
> Principals. This will probably be an issue when using the "inherit" action
> though.
Using the inherit action has noting to do with how many principals are
linked to a permission.
Currently inherit action is primarily intended for the following situation:
A page has both secure and normal components, the secure components
allow for editing of the modelobject of the page (for the sake of this
example i will assume they are textfields).
All components should always be visible but only editable if
sufficient permissions are granted. The policy would look something
like this:
grant principal "foo.read"
{
permission ${ComponentPermission} "org.MyPage", "inherit, render";
// to allow all components to be rendered
//using only render would require separate render permissions for each
component like so
//permission ${ComponentPermission} "org.MyPage:secureTextField1",
"render"; //etc for each secure component
//assuming we have 1 or more links pointing to our page we also need
the following permission
permission ${ComponentPermission} "org.MyPage", "enable";
//note the absence of the inherit permission compared to the next principal
//by not using inherit the enable action is only granted to the page
itself not to any of the secure components it contains
};
grant principal "foo.write"
{
permission ${ComponentPermission} "org.MyPage", "inherit, enable";
//to allow the user to use all the secure textfields on the page
}
If you want to prevent permissions to be linked to to many principals
you should use Principal.implies(Subject subject);
The above example works without this implies because the "inherit,
enable" actions already imply the "inherit, render" actions for the
same component(s).
In the following example however that is not going to work:
Say we have a display page and an edit page, in this example it does
not matter if the edit page contains secure components or not because
the entire page is only visible if you have sufficient permissions.
grant principal "foo.read"
{
permission ${ComponentPermission} "org.MyDisplayPage", "inherit, render";
// still using inherit here out of habbit
//assuming we have 1 or more links pointing to our display page we
also need the following permission
permission ${ComponentPermission} "org.MyDisplayPage", "enable";
};
grant principal "foo.write"
{
permission ${ComponentPermission} "org.MyEditPage", "inherit, render";
//assuming we only have normal textfields and stuff on the page
//the display page probably has a securepagelink pointing to our edit
page so we need to grant permission for that
permission ${ComponentPermission} "org.MyRenderPage", "enable";
}
We could solve the above example 2 ways:
- the subject would need to have both foo.read and foo.write for him
to access the edit page through the edit button on the display page
-or we use principal.implies to specify that if the user only has
foo.write we can safely assume he also (should) have foo.read
What happens in swarm is this:
1 user tries to go to display page
2 check render permission for display page
3 detects none of the principals from the subject have this permission
(remember or subject only has foo.write)
4 check each of the principals that contain the permission (as
specified in the hive) if they imply the subject
5 foo.read principal detects the subject has the foo.write principal
and signals that the permission is granted
6 wicket renders page
The way we handle principal.implies in our application is by letting
our principal have a doubly linked list of both principals it implies
and principals it is implied by, the check to see if the subject has
another principal it is implied by is then easy.
phew, this mail certainly got a lot longer than i intended and might
haven gotten a bit off-topic but i got the feeling some things were
not quite crystal clear :)
Maurice
>
>
> > -----Original Message-----
> > From: Maurice Marrink [mailto:marrink@gmail.com]
> > Sent: Tuesday, February 19, 2008 1:27 PM
> > To: users@wicket.apache.org
> > Subject: Re: Wicket-security wish list
> >
> >
> > Thanks,
> >
> > Glad i could help.
> >
> > I like the idea of custom error messages but i doubt i will make them
> > configurable in the policy file, mainly because i would like to follow
> > the jaas policy format as close as possible and because a permission
> > can be part of multiple principals: what would we do then display the
> > message from each principal?
> > I am thinking more in the lines of using Session.error() to display
> > localized messages in the properties files currently used by wicket.
> > But I will have to think about this. Thanks for the suggestion.
> > I have created a jira issue so i won't forget it :)
> > http://wicketstuff.org/jira/browse/WSSWARM-6
> >
> > Maurice
> >
> > On Feb 19, 2008 8:47 PM, Warren <wa...@clarksnutrition.com> wrote:
> > > Maurice,
> > >
> > > I was thinking about this "Access Denied" message problem I have been
> > > working on and thought up some features that might be useful in future
> > > releases. It would be nice to be able to configure "Access
> > Denied" messages
> > > directly into the hive like this:
> > >
> > > grant principal
> > com.scanman.security.authorization.ScanManPrincipal "ScanMan
> > > Receiving" "Principal Access Denied Message Here"
> > > {
> > > permission ${ComponentPermission} "${RecvMenu}",
> > "inherit, render, enable",
> > > "Permission Access Denied Message Here";
> > > };
> > > grant principal
> > com.scanman.security.authorization.ScanManPrincipal "ScanMan
> > > Ordering" "Principal Access Denied Message Here"
> > > {
> > > permission ${ComponentPermission} "${OrderMenu}",
> > "inherit, render,
> > > enable", "Permission Access Denied Message Here";
> > > };
> > >
> > > I believe you are following some kind of standard for how the hive is
> > > set-up, so I am not sure this would work. But anyway, you could
> > then set-up
> > > the configuration of how these messages were used in the
> > > SwarmWebApplication. For Example, put them into the error queue, or take
> > > advantage of message resources, message keys and localization
> > and so on. I
> > > ended up putting these messages into the error queue from
> > MySwarmStrategy
> > > and it works great.
> > >
> > > I can't imagine that a feature like this would not be of some
> > value to other
> > > users. My app has a lot of different levels of security and
> > permissions that
> > > the Administrative user can configure within a separate "Point
> > of Sale" app.
> > > Messages of this sort are valuable to a user so that security levels and
> > > permissions can be tweaked to best suit a companies policies. A simple
> > > "Access Denied" message gives little clue as to why access was denied.
> > >
> > > That's my two cents. Thanks for all the help you have given me.
> > Your project
> > > surely deserves a lot of credit.
> > >
> > > Thanks,
> > >
> > > Warren Bell
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: Wicket-security wish list
Posted by Warren <wa...@clarksnutrition.com>.
Maurice,
Session.error() is how I ended up solving my problem. But, I formatted the
message in my session and then ended up calling error(...), that way
SwarmStrategy was just returning the denied Principals. I did not get as far
as placing the message in a Properties file. I was not sure how to
accommodate multiple denied Principals. As far as the multiple principals in
my app, I simply formatted my message like this:
Users in User Group XXX do not have Access to "Access Denied Principal 1"
and "Access Denied Principal 2" ...
I know that this can get a little verbose, but I am trying to set up my
policy file so that any one permission does not end up in too many different
Principals. This will probably be an issue when using the "inherit" action
though.
> -----Original Message-----
> From: Maurice Marrink [mailto:marrink@gmail.com]
> Sent: Tuesday, February 19, 2008 1:27 PM
> To: users@wicket.apache.org
> Subject: Re: Wicket-security wish list
>
>
> Thanks,
>
> Glad i could help.
>
> I like the idea of custom error messages but i doubt i will make them
> configurable in the policy file, mainly because i would like to follow
> the jaas policy format as close as possible and because a permission
> can be part of multiple principals: what would we do then display the
> message from each principal?
> I am thinking more in the lines of using Session.error() to display
> localized messages in the properties files currently used by wicket.
> But I will have to think about this. Thanks for the suggestion.
> I have created a jira issue so i won't forget it :)
> http://wicketstuff.org/jira/browse/WSSWARM-6
>
> Maurice
>
> On Feb 19, 2008 8:47 PM, Warren <wa...@clarksnutrition.com> wrote:
> > Maurice,
> >
> > I was thinking about this "Access Denied" message problem I have been
> > working on and thought up some features that might be useful in future
> > releases. It would be nice to be able to configure "Access
> Denied" messages
> > directly into the hive like this:
> >
> > grant principal
> com.scanman.security.authorization.ScanManPrincipal "ScanMan
> > Receiving" "Principal Access Denied Message Here"
> > {
> > permission ${ComponentPermission} "${RecvMenu}",
> "inherit, render, enable",
> > "Permission Access Denied Message Here";
> > };
> > grant principal
> com.scanman.security.authorization.ScanManPrincipal "ScanMan
> > Ordering" "Principal Access Denied Message Here"
> > {
> > permission ${ComponentPermission} "${OrderMenu}",
> "inherit, render,
> > enable", "Permission Access Denied Message Here";
> > };
> >
> > I believe you are following some kind of standard for how the hive is
> > set-up, so I am not sure this would work. But anyway, you could
> then set-up
> > the configuration of how these messages were used in the
> > SwarmWebApplication. For Example, put them into the error queue, or take
> > advantage of message resources, message keys and localization
> and so on. I
> > ended up putting these messages into the error queue from
> MySwarmStrategy
> > and it works great.
> >
> > I can't imagine that a feature like this would not be of some
> value to other
> > users. My app has a lot of different levels of security and
> permissions that
> > the Administrative user can configure within a separate "Point
> of Sale" app.
> > Messages of this sort are valuable to a user so that security levels and
> > permissions can be tweaked to best suit a companies policies. A simple
> > "Access Denied" message gives little clue as to why access was denied.
> >
> > That's my two cents. Thanks for all the help you have given me.
> Your project
> > surely deserves a lot of credit.
> >
> > Thanks,
> >
> > Warren Bell
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket-security wish list
Posted by Maurice Marrink <ma...@gmail.com>.
Thanks,
Glad i could help.
I like the idea of custom error messages but i doubt i will make them
configurable in the policy file, mainly because i would like to follow
the jaas policy format as close as possible and because a permission
can be part of multiple principals: what would we do then display the
message from each principal?
I am thinking more in the lines of using Session.error() to display
localized messages in the properties files currently used by wicket.
But I will have to think about this. Thanks for the suggestion.
I have created a jira issue so i won't forget it :)
http://wicketstuff.org/jira/browse/WSSWARM-6
Maurice
On Feb 19, 2008 8:47 PM, Warren <wa...@clarksnutrition.com> wrote:
> Maurice,
>
> I was thinking about this "Access Denied" message problem I have been
> working on and thought up some features that might be useful in future
> releases. It would be nice to be able to configure "Access Denied" messages
> directly into the hive like this:
>
> grant principal com.scanman.security.authorization.ScanManPrincipal "ScanMan
> Receiving" "Principal Access Denied Message Here"
> {
> permission ${ComponentPermission} "${RecvMenu}", "inherit, render, enable",
> "Permission Access Denied Message Here";
> };
> grant principal com.scanman.security.authorization.ScanManPrincipal "ScanMan
> Ordering" "Principal Access Denied Message Here"
> {
> permission ${ComponentPermission} "${OrderMenu}", "inherit, render,
> enable", "Permission Access Denied Message Here";
> };
>
> I believe you are following some kind of standard for how the hive is
> set-up, so I am not sure this would work. But anyway, you could then set-up
> the configuration of how these messages were used in the
> SwarmWebApplication. For Example, put them into the error queue, or take
> advantage of message resources, message keys and localization and so on. I
> ended up putting these messages into the error queue from MySwarmStrategy
> and it works great.
>
> I can't imagine that a feature like this would not be of some value to other
> users. My app has a lot of different levels of security and permissions that
> the Administrative user can configure within a separate "Point of Sale" app.
> Messages of this sort are valuable to a user so that security levels and
> permissions can be tweaked to best suit a companies policies. A simple
> "Access Denied" message gives little clue as to why access was denied.
>
> That's my two cents. Thanks for all the help you have given me. Your project
> surely deserves a lot of credit.
>
> Thanks,
>
> Warren Bell
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org