Search in sources :

Example 41 with Schema

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

the class DocumentSchemaDescriptor method getSchema.

@Override
public Schema getSchema() {
    Schema schema = new Schema(Document.class, SINGULAR, PLURAL);
    schema.setRelativeApiEndpoint(API_ENDPOINT);
    schema.setOrder(2000);
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE_PUBLIC, Lists.newArrayList("F_DOCUMENT_PUBLIC_ADD")));
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE_PRIVATE, Lists.newArrayList("F_DOCUMENT_PRIVATE_ADD")));
    schema.getAuthorities().add(new Authority(AuthorityType.EXTERNALIZE, Lists.newArrayList("F_DOCUMENT_EXTERNAL")));
    schema.getAuthorities().add(new Authority(AuthorityType.DELETE, Lists.newArrayList("F_DOCUMENT_DELETE")));
    return schema;
}
Also used : Authority(org.hisp.dhis.security.Authority) Schema(org.hisp.dhis.schema.Schema)

Example 42 with Schema

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

the class IndicatorSchemaDescriptor method getSchema.

@Override
public Schema getSchema() {
    Schema schema = new Schema(Indicator.class, SINGULAR, PLURAL);
    schema.setRelativeApiEndpoint(API_ENDPOINT);
    schema.setOrder(1250);
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE_PUBLIC, Lists.newArrayList("F_INDICATOR_PUBLIC_ADD")));
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE_PRIVATE, Lists.newArrayList("F_INDICATOR_PRIVATE_ADD")));
    schema.getAuthorities().add(new Authority(AuthorityType.DELETE, Lists.newArrayList("F_INDICATOR_DELETE")));
    return schema;
}
Also used : Authority(org.hisp.dhis.security.Authority) Schema(org.hisp.dhis.schema.Schema)

Example 43 with Schema

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

the class IndicatorTypeSchemaDescriptor method getSchema.

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

Example 44 with Schema

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

the class InterpretationSchemaDescriptor method getSchema.

@Override
public Schema getSchema() {
    Schema schema = new Schema(Interpretation.class, SINGULAR, PLURAL);
    schema.setRelativeApiEndpoint(API_ENDPOINT);
    return schema;
}
Also used : Schema(org.hisp.dhis.schema.Schema)

Example 45 with Schema

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

the class ColorSetSchemaDescriptor method getSchema.

@Override
public Schema getSchema() {
    Schema schema = new Schema(ColorSet.class, SINGULAR, PLURAL);
    schema.setRelativeApiEndpoint(API_ENDPOINT);
    schema.setOrder(1080);
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE, Lists.newArrayList("F_COLOR_SET_ADD")));
    schema.getAuthorities().add(new Authority(AuthorityType.DELETE, Lists.newArrayList("F_COLOR_SET_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