Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

#labels Featured
= Annotation =

For a declaratory security management at our disposal is the following annotations
{{{
/* For methods */
@RequiresPermissions
@RequiresRoles
@RequiresUser
@RequiresGuest
@RequiresAuthentication

/* For classes */
@RequiresPermissionsAll
@RequiresRolesAll
@RequiresUserAll
@RequiresGuestAll
@RequiresAuthenticationAll
}}}

== Secure pages ==

{{{
@RequiresRoleAll("admin")
public class AdminPage {
}
}}}

== Secure actions ==

{{{
public class Index {

@RequiresRule("news:delete")
public void onActionFromDeleteNews(EventContext eventContext)

Unknown macro: { ... }

}
}}}
== Secure Services ==

=== Secure Service Method ===
{{{

public interface AlphaService

Unknown macro: { @RequiresAuthentication void secureMethod(); }

public class AlphaServiceImpl implements AlphaService {

@Override
public void secureMethod()

Unknown macro: { ... }

}

}}}

=== Secure Service Class ===
{{{

@RequiresAuthentication
public interface AlphaService {

void secureMethod1();

void secureMethod2();
}

public class AlphaServiceImpl implements AlphaService {

@Override
public void secureMethod1()

@Override
public void secureMethod2()

Unknown macro: { ... }


}

}}}

= Filters =

The configuration of filters is fully consistent with the documentation JSecurity. By default configuration is configured in the file security.conf section [url]
{{{
[urls]

/authc/signup = anon
/authc/** = authc

/user/signup = anon
/user/** = user

/site/user/** = roles[user]
/site/manager/** = roles[manager]

/news/view/** = perms[news:view]
/news/edit/** = perms[news:edit]
}}}

= Components =
{{{
Authenticated
NotAuthenticated
User
Guest
HasAnyRoles
HasPermission
HasRole
LacksPermission
LacksRole
LoginForm
LoginLink
}}}
== Examples ==
{{{
<t:jsec.user>
Hello, $

Unknown macro: {username}

</t:jsec.user>
}}}

{{{
<t:jsec.guest>
<t:actionlink t:id="createAccount">Create account</t:actionlink>
</t:jsec.guest>
}}}

{{{
<t:jsec.hasRole role="admin">
<t:actionlink t:id="delete">delete user</t:actionlink>
</t:jsec.user>
}}}

= Spring Integration =
Tapestry-JSecurity can be used in spring environment.

  • No labels