Managed to find my own answers. So posting here for completeness for
anyone searching.
Seems to add entries to the security area you just need these somewhere.
import hudson.security.Permission;
import hudson.security.PermissionGroup;
import hudson.security.PermissionScope;
import hudson.Extension;
import jenkins.model.Jenkins;
import org.jenkinsci.Symbol;
@Extension
@Symbol("myPermissions")
public class MyPermissions {
public static final PermissionGroup PERMISSION_GROUP =
new PermissionGroup(MyPermissions.class,
Messages._PermissionGroup_Title());
public static final Permission MANUAL_SYNC_PERMISSION =
new Permission(PERMISSION_GROUP,
"ManualSync",
Messages._PermissionManualSync_Description(),
Jenkins.ADMINISTER,
PermissionScope.JENKINS);
public static final Permission UPLOAD_MAP_PERMISSION =
new Permission(PERMISSION_GROUP,
"UploadMap",
Messages._PermissionUploadMap_Description(),
Jenkins.ADMINISTER,
PermissionScope.JENKINS);
}
As for storing arbitrary data, this is doing my trick:
https://plugins.jenkins.io/database-sqlite/
import org.jenkinsci.plugins.database.Database;
import org.jenkinsci.plugins.database.GlobalDatabaseConfiguration;
import org.jenkinsci.plugins.database.BasicDataSource2;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.PreparedStatement;
import java.sql.Statement;
import java.sql.SQLException;
...
private GlobalDatabaseConfiguration globalDatabaseConfiguration;
private Database database;
private DataSource datasource;
...
this.globalDatabaseConfiguration = GlobalDatabaseConfiguration.get();
this.database = this.globalDatabaseConfiguration.getDatabase();
this.datasource = this.database.getDataSource();
CreateTables();
On Saturday, July 25, 2020 at 11:18:49 AM UTC-4, Michael Carter wrote:
>
> Two questions this morning.
>
> Want to add my own options to the:
> Project-based Matrix Authorization Strategy
>
> area of the Global Security Screen. Where do I find a clear example on
> how to do that or the documentation?
>
> Also, I want to store data with Jenkins that's not tied to a job/build.
> What's the best way to go about it or just bounce out to some DB? This is
> rolling in a few ideas, but one is system test data. No point running the
> deploy if all the target servers are offline or have problems. Basically
> want to offer a screen in the admin area where someone could look to see if
> anything in their path is offline.
>
> Thanks,
> Michael
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/e9188523-0d1e-48ca-af98-cd476e026a5co%40googlegroups.com.