Yea Action. Ok Thanks.

On Tue, Oct 15, 2013 at 5:58 PM, Dan Haywood
<[email protected]>wrote:

> When you say methods, I think you mean what Isis calls actions (as opposed
> to the getter/setter methods that represent properties and collections).
>
> If so, the yes.
>
> Use the Identifier.Type enum to distinguish which sort of member
> (property/collection/action) you are protecting.
>
> Or, if you want more fine-grained control, use the regular disableXxx() for
> each 'xxx' member, eg:
>
> public String getFirstName() { ... }
> public void setFirstName(String fn) { ... }
> public String disableFirstName() { return owner()? null: "oh no you
> don't!"; }
>
> private boolean owner() { return
> getCreatedBy().equals(container.getUserName());
>
>
> Dan
>
>
>
> On 15 October 2013 17:53, james agada <[email protected]> wrote:
>
> > Thanks. If I had methods, will this also apply to them ie I have a method
> > like "Process" that appears on the menu when the entity is shown. Can I
> use
> > the same approach to disable it?
> >
> >
> > On Tue, Oct 15, 2013 at 5:10 PM, Dan Haywood
> > <[email protected]>wrote:
> >
> > > something like:
> > >
> > > public class SomeClass {
> > >
> > >     private String createdBy;
> > >     ...
> > >
> > >     public String disabled(Identifier.Type type) {
> > >         return createdBy.equals(container.getUserName())? null: "Only
> the
> > > creator can modify this object";
> > >     }
> > > }
> > >
> > > HTH
> > > Dan
> > >
> > >
> > >
> > > On 15 October 2013 17:01, james agada <[email protected]> wrote:
> > >
> > > > I want to allow only the creator of a record to be the one able to do
> > it.
> > > > Any ideas?
> > > >
> > >
> >
>

Reply via email to