Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetbehl committed Aug 24, 2023
1 parent 2d6d5b6 commit 044d886
Show file tree
Hide file tree
Showing 12 changed files with 115 additions and 514 deletions.
36 changes: 18 additions & 18 deletions gradle/docs.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
String versionTxt = project.projectVersion
boolean isSnapshot = versionTxt.endsWith('SNAPSHOT')
boolean isBeta = versionTxt.contains('RC') || versionTxt.contains('M')
String stableVersion = ''
String snapshotVersion = ''
String[] arr = versionTxt.tokenize('.')
int major = arr[0] as int
int minor = arr[1] as int
int patch
if (isSnapshot || isBeta || arr[2].endsWith("TEST")) {
patch = arr[2].split('-')[0] as int
} else {
patch = arr[2] as int
}

if (isSnapshot || isBeta) {
stableVersion = "${major}.${minor}.${(patch-1)}".toString()
snapshotVersion = versionTxt
} else {
stableVersion = versionTxt
snapshotVersion = "${major}.${minor}.${patch+1}-SNAPSHOT".toString()
String[] parts = versionTxt.split("\\.")
if (parts.length >= 3) {
int major = parts[0] as int
int minor = parts[1] as int
int patch
if (parts.length > 3) {
patch = parts[2] as int
stableVersion = "$major.$minor.${patch-1}"
snapshotVersion = versionTxt
} else if (parts[2].contains('-')) {
final String[] subparts = parts[2].split("-")
patch = subparts.first() as int
stableVersion = "${major}.${minor}.${patch - 1}"
snapshotVersion = "${major}.${minor}." + subparts[1..-1].join("-")
} else {
stableVersion = versionTxt
snapshotVersion = "$major.$minor.${patch + 1}"
}
}

def asciidoctorAttributes = [
Expand Down
2 changes: 2 additions & 0 deletions plugin/src/docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ include::{includedir}introduction.adoc[]

include::{includedir}whatsNew.adoc[]

include::{includedir}installation.adoc[]

include::{includedir}domainClasses.adoc[]

include::{includedir}requestMappings.adoc[]
Expand Down
72 changes: 72 additions & 0 deletions plugin/src/docs/installation.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[[installation]]
== Installation

=== Prerequisites

Ensure you have the following set up:

* A Grails project
* A working internet connection

==== Installation Steps

1. Open your Grails project.

2. Locate your `build.gradle` file in the root directory of your project.

3. Add the Spring Security Core Plugin dependency to the `dependencies` section in your `build.gradle`:

[source,groovy]
----
dependencies {
// ... other dependencies
implementation 'org.grails.plugins:spring-security-core:${stableVersion}'
}
----

4. Save the `build.gradle` file.

5. Open a terminal or command prompt.

6. Navigate to your project's root directory using the `cd` command.

7. Run the following Gradle command to update your project's dependencies:

+
[source,bash]
----
./gradlew clean build
----
+

8. The Spring Security Core Plugin 6.0.0 is now installed and integrated into your Grails project.

9. You can start using the plugin's features and commands in your application.

10. Run the <<s2-quickstart>> script to generate domain classes and add the initial configuration settings in `application.groovy`:

+
[source,bash]
```
./gradlew runCommand "-Pargs=s2-quickstart com.yourapp User Role"
```

=== Verifying Installation

To verify that the plugin has been successfully installed, you can run a simple test:

1. In your Grails project, create a new controller or use an existing one.

2. Add a secure annotation, such as `@Secured(['ROLE_USER'])`, to a method in your controller.

3. Run your Grails application using the command:

+
[source,bash]
----
./gradlew bootRun
----
+

4. Access the URL associated with the method you secured. If the plugin is correctly installed, it should enforce the security constraint you defined.

125 changes: 0 additions & 125 deletions plugin/src/docs/introduction.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,131 +5,6 @@ The Spring Security plugin simplifies the integration of https://projects.spring

This guide documents configuration defaults and describes how to configure and extend the Spring Security plugin for Grails applications.

=== Release History and Acknowledgment
* Please check https://github.com/grails/grails-spring-security-core[GitHub Release Page] for recent release history
* October 16, 2020
** 4.0.3
* July 17, 2020
** 4.0.2
* July 13, 2020
** 4.0.1
* February 27, 2020
** 4.0.0
* May 25, 2019
** 4.0.0.RC2 release
* May 13, 2019
** 4.0.0.RC1 release
* April 8, 2019
** 4.0.0.M1 release
* Jul 24, 2018
** 3.2.3 release
* Jun 24, 2018
** 3.2.2 release
* Feb 13, 2018
** 3.2.1 release
* Sep 26, 2017
** 3.2.0 release
* May 18, 2017
** 3.2.0.M1 release
* April 22, 2017
** 3.1.2 release
* May 10, 2016
** 3.1.1 release
* May 10, 2016
** 3.1.0 release
* March 21, 2016
** 3.0.4 release
* January 10, 2016
** 3.0.3 release
* January 6, 2016
** 3.0.2 release
* December 31, 2015
** 3.0.1 release
* December 8, 2015
** 3.0.0 release
* November 23, 2015
** 3.0.0.M2 release
* August 14, 2015
** 3.0.0.M1 release
* June 4, 2015
** 2.0-RC5 release
* July 8, 2014
** 2.0-RC4 release
* May 19, 2014
** 2.0-RC3 release
* October 4, 2013
** 2.0-RC2 release
** http://jira.grails.org/issues/?jql=project%20%3D%20GPSPRINGSECURITYCORE%20AND%20fixVersion%20%3D%20%22Grails-Spring-Security-Core%202.0%22%20ORDER%20BY%20updated%20DESC%2C%20priority%20DESC%2C%20created%20ASC[JIRA Issues]
* October 3, 2013
** 2.0-RC1 release
* April 6, 2012
** 1.2.7.3 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=13100[JIRA Issues]
* February 2, 2012
** 1.2.7.2 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=13062[JIRA Issues]
* January 18, 2012
** 1.2.7.1 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=13051[JIRA Issues]
* December 30, 2011
** 1.2.7 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=13025[JIRA Issues]
* December 2, 2011
** 1.2.6 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=13024[JIRA Issues]
* December 1, 2011
** 1.2.5 release
* October 18, 2011
** 1.2.4 release
* October 15, 2011
** 1.2.3 release
* October 15, 2011
** 1.2.2 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=12907[JIRA Issues]
* August 17, 2011
** 1.2.1 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=12811[JIRA Issues]
* July 31, 2011
** 1.2 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=12503[JIRA Issues]
* May 23, 2011
** 1.1.3 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=12502[JIRA Issues]
* February 26, 2011
** 1.1.2 release
* February 26, 2011
** 1.1.1 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=11909[JIRA Issues]
* August 8, 2010
** 1.1 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=11908[JIRA Issues]
* August 1, 2010
** 1.0.1 release
* July 27, 2010
** 1.0 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=11907[JIRA Issues]
* July 16, 2010
** 0.4.2 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=11906[JIRA Issues]
* June 29, 2010
** 0.4.1 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=11905[JIRA Issues]
* June 21, 2010
** 0.4 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=11904[JIRA Issues]
* May 12, 2010
** 0.3.1 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=11903[JIRA Issues]
* May 12, 2010
** 0.3 release
** http://jira.grails.org/secure/ReleaseNote.jspa?projectId=10229&amp;version=11902[JIRA Issues]
* May 2, 2010
** 0.2 release
* April 27, 2010
** initial 0.1 release

This plugin is based on work done for the https://grails.org/plugin/acegi/[Acegi] plugin by Tsuyoshi Yamamoto.

include::introduction/configGroovy.adoc[]

include::introduction/gettingStarted.adoc[]
Loading

0 comments on commit 044d886

Please sign in to comment.