Search in sources :

Example 51 with Schema

use of org.hisp.dhis.schema.Schema in project dhis2-core by dhis2.

the class OrganisationUnitLevelSchemaDescriptor method getSchema.

@Override
public Schema getSchema() {
    Schema schema = new Schema(OrganisationUnitLevel.class, SINGULAR, PLURAL);
    schema.setRelativeApiEndpoint(API_ENDPOINT);
    schema.setOrder(1110);
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE, Lists.newArrayList("F_ORGANISATIONUNITLEVEL_UPDATE")));
    schema.getAuthorities().add(new Authority(AuthorityType.UPDATE, Lists.newArrayList("F_ORGANISATIONUNITLEVEL_UPDATE")));
    schema.getAuthorities().add(new Authority(AuthorityType.DELETE, Lists.newArrayList("F_ORGANISATIONUNITLEVEL_UPDATE")));
    return schema;
}
Also used : Authority(org.hisp.dhis.security.Authority) Schema(org.hisp.dhis.schema.Schema)

Example 52 with Schema

use of org.hisp.dhis.schema.Schema in project dhis2-core by dhis2.

the class OrganisationUnitSchemaDescriptor method getSchema.

@Override
public Schema getSchema() {
    Schema schema = new Schema(OrganisationUnit.class, SINGULAR, PLURAL);
    schema.setRelativeApiEndpoint(API_ENDPOINT);
    schema.setOrder(1100);
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE, Lists.newArrayList("F_ORGANISATIONUNIT_ADD")));
    schema.getAuthorities().add(new Authority(AuthorityType.DELETE, Lists.newArrayList("F_ORGANISATIONUNIT_DELETE")));
    return schema;
}
Also used : Authority(org.hisp.dhis.security.Authority) Schema(org.hisp.dhis.schema.Schema)

Example 53 with Schema

use of org.hisp.dhis.schema.Schema in project dhis2-core by dhis2.

the class PredictorSchemaDescriptor method getSchema.

@Override
public Schema getSchema() {
    Schema schema = new Schema(Predictor.class, SINGULAR, PLURAL);
    schema.setRelativeApiEndpoint(API_ENDPOINT);
    schema.setOrder(2001);
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE, Lists.newArrayList("F_PREDICTOR_ADD")));
    schema.getAuthorities().add(new Authority(AuthorityType.DELETE, Lists.newArrayList("F_PREDICTOR_DELETE")));
    return schema;
}
Also used : Authority(org.hisp.dhis.security.Authority) Schema(org.hisp.dhis.schema.Schema)

Example 54 with Schema

use of org.hisp.dhis.schema.Schema in project dhis2-core by dhis2.

the class DataElementGroupSetSchemaDescriptor method getSchema.

@Override
public Schema getSchema() {
    Schema schema = new Schema(DataElementGroupSet.class, SINGULAR, PLURAL);
    schema.setRelativeApiEndpoint(API_ENDPOINT);
    schema.setOrder(1220);
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE_PUBLIC, Lists.newArrayList("F_DATAELEMENTGROUPSET_PUBLIC_ADD")));
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE_PRIVATE, Lists.newArrayList("F_DATAELEMENTGROUPSET_PRIVATE_ADD")));
    schema.getAuthorities().add(new Authority(AuthorityType.DELETE, Lists.newArrayList("F_DATAELEMENTGROUPSET_DELETE")));
    return schema;
}
Also used : Authority(org.hisp.dhis.security.Authority) Schema(org.hisp.dhis.schema.Schema)

Example 55 with Schema

use of org.hisp.dhis.schema.Schema in project dhis2-core by dhis2.

the class CategorySchemaDescriptor method getSchema.

@Override
public Schema getSchema() {
    Schema schema = new Schema(DataElementCategory.class, SINGULAR, PLURAL);
    schema.setRelativeApiEndpoint(API_ENDPOINT);
    schema.setOrder(1170);
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE_PUBLIC, Lists.newArrayList("F_CATEGORY_PUBLIC_ADD")));
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE_PRIVATE, Lists.newArrayList("F_CATEGORY_PRIVATE_ADD")));
    schema.getAuthorities().add(new Authority(AuthorityType.DELETE, Lists.newArrayList("F_CATEGORY_DELETE")));
    return schema;
}
Also used : Authority(org.hisp.dhis.security.Authority) Schema(org.hisp.dhis.schema.Schema)

Aggregations

Schema (org.hisp.dhis.schema.Schema)149 Authority (org.hisp.dhis.security.Authority)65 Property (org.hisp.dhis.schema.Property)29 ArrayList (java.util.ArrayList)20 IdentifiableObject (org.hisp.dhis.common.IdentifiableObject)20 Test (org.junit.Test)16 Collection (java.util.Collection)14 List (java.util.List)13 HashMap (java.util.HashMap)12 DhisSpringTest (org.hisp.dhis.DhisSpringTest)12 EmbeddedObject (org.hisp.dhis.common.EmbeddedObject)12 Map (java.util.Map)10 BaseIdentifiableObject (org.hisp.dhis.common.BaseIdentifiableObject)10 User (org.hisp.dhis.user.User)10 AnalyticalObject (org.hisp.dhis.common.AnalyticalObject)9 BaseAnalyticalObject (org.hisp.dhis.common.BaseAnalyticalObject)9 UserCredentials (org.hisp.dhis.user.UserCredentials)9 HashSet (java.util.HashSet)8 Set (java.util.Set)8 Log (org.apache.commons.logging.Log)8