Skip to content

Commit

Permalink
remove dead or deprecated features or features that will be moved to …
Browse files Browse the repository at this point in the history
…external plugins
  • Loading branch information
graemerocher committed Feb 25, 2015
1 parent 3b7fb4b commit b1e4eed
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 494 deletions.
30 changes: 17 additions & 13 deletions src/en/guide/security/authentication.gdoc
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
Grails has no default mechanism for authentication as it is possible to implement authentication in many different ways. It is however, easy to implement a simple authentication mechanism using either [interceptors|guide:interceptors] or [filters|guide:filters]. This is sufficient for simple use cases but it's highly preferable to use an established security framework, for example by using the [Spring Security|guide:springSecurity] or the [Shiro|guide:shiro] plugin.
Grails has no default mechanism for authentication as it is possible to implement authentication in many different ways. It is however, easy to implement a simple authentication mechanism using [interceptors|guide:interceptors]. This is sufficient for simple use cases but it's highly preferable to use an established security framework, for example by using the [Spring Security|guide:springSecurity] or the [Shiro|guide:shiro] plugin.

Filters let you apply authentication across all controllers or across a URI space. For example you can create a new set of filters in a class called @grails-app/conf/SecurityFilters.groovy@ by running:
Interceptors let you apply authentication across all controllers or across a URI space. For example you can create a new set of filters in a class called @grails-app/controllers/SecurityInterceptor.groovy@ by running:

{code}
grails create-filters security
grails create-interceptor security
{code}

and implement your interception logic there:

{code:java}
class SecurityFilters {
def filters = {
loginCheck(controller: '*', action: '*') {
before = {
if (!session.user && actionName != "login") {
redirect(controller: "user", action: "login")
return false
}
}
class SecurityInterceptor {

SecurityInterceptor() {
matchAll()
except(controller:'user', action:'login')
}

boolean before() {
if (!session.user && actionName != "login") {
redirect(controller: "user", action: "login")
return false
}
return true
}

}
{code}

Here the @loginCheck@ filter intercepts execution _before_ all actions except @login@ are executed, and if there is no user in the session then redirect to the @login@ action.
Here the interceptor intercepts execution _before_ all actions except @login@ are executed, and if there is no user in the session then redirect to the @login@ action.

The @login@ action itself is simple too:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Often it is useful to intercept processing based on either request, session or application state. This can be achieved with action interceptors. There are currently two types of interceptors: before and after.

{note}
If your interceptor is likely to apply to more than one controller, you are almost certainly better off writing a [Filter|guide:filters]. Filters can be applied to multiple controllers or URIs without the need to change the logic of each controller
If your interceptor is likely to apply to more than one controller, you are almost certainly better off writing a standalone [Interceptor|guide:interceptors]. Standaline Interceptors can be applied to multiple controllers or URIs without the need to change the logic of each controller
{note}

h4. Before Interception
Expand Down
2 changes: 1 addition & 1 deletion src/en/guide/theWebLayer/gsp/viewsAndTemplates.gdoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This can be expressed with the @tmpl@ namespace as follows:

h4. Templates in Controllers and Tag Libraries

You can also render templates from controllers using the [render|controllers] controller method. This is useful for [Ajax|guide:ajax] applications where you generate small HTML or data responses to partially update the current page instead of performing new request:
You can also render templates from controllers using the [render|controllers] controller method. This is useful for JavaScript heavy applications where you generate small HTML or data responses to partially update the current page instead of performing new request:

{code:java}
def bookData() {
Expand Down
2 changes: 1 addition & 1 deletion src/en/guide/theWebLayer/interceptors.gdoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Although Grails [controllers|guide:controllers] support fine grained interceptors, these are only really useful when applied to a few controllers and become difficult to manage with larger applications.

To solve this you can create standalone Interceptors using the [commandLine|create-interceptors] command:
To solve this you can create standalone Interceptors using the [create-interceptor|commandLine] command:

{code}
$ grails create-interceptor MyInterceptor
Expand Down
32 changes: 11 additions & 21 deletions src/en/ref/Command Line/list-plugins.gdoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,19 @@ grails list-plugins -repository=myRepository
grails list-plugins -installed
{code}

Fired Events:

* @StatusUpdate@ - When the plugin list is being refreshed
* @StatusError@ - When there was an error updating the plugin list

Arguments:

* @repository@ - The name of the repository to use, otherwise all known repositories will be scanned. See the section on [Plugin repositories|guide:repositories] in the user guide.
* @installed@ - List only the plugins that are installed into the current Grails application.

Lists the plugins that are installable. Note: This command can take a while to execute depending in your internet connectivity. Typical output looks like this:

{code}
Plugins available in the grailsCentral repository are listed below:
-------------------------------------------------------------
acegi <0.5.3.2> -- Grails Spring Security 2.0 Plugin
activemq <0.3> -- Grails ActiveMQ Plugin
activiti <5.6> -- Grails Activiti Plugin
ajax-uploader <0.3> -- Ajax Uploader Plugin
ajaxflow <0.2.1> -- This plugin enables Ajaxified Webflows
akismet <0.2> -- Akismet Anti-Spam Plugin
alfresco <0.4> -- Plugin de integracion con Alfresco.
...
| Available Plugins
* asset-pipeline
* cache
* cache-ehcache
* fields
* geb
* hibernate
* mongodb
* quartz
* scaffolding
{code}

The first column contains the plugin name, the second the version and the last the description. If you require more info about a plugin you can use the [plugin-info|commandLine] command. If you wish to install a plugin you can use the plugin name and/or version in combination with the [install-plugin|commandLine].
The first column contains the plugin name, the second the version and the last the description. If you require more info about a plugin you can use the [plugin-info|commandLine] command.
42 changes: 0 additions & 42 deletions src/en/ref/Plug-ins/filters.gdoc

This file was deleted.

89 changes: 0 additions & 89 deletions src/en/ref/Tags/formRemote.gdoc

This file was deleted.

66 changes: 0 additions & 66 deletions src/en/ref/Tags/remoteField.gdoc

This file was deleted.

85 changes: 0 additions & 85 deletions src/en/ref/Tags/remoteFunction.gdoc

This file was deleted.

Loading

0 comments on commit b1e4eed

Please sign in to comment.