Search in sources :

Example 46 with Schema

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

the class ConstantSchemaDescriptor method getSchema.

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

Example 47 with Schema

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

the class DashboardItemSchemaDescriptor method getSchema.

@Override
public Schema getSchema() {
    Schema schema = new Schema(DashboardItem.class, SINGULAR, PLURAL);
    schema.setRelativeApiEndpoint(API_ENDPOINT);
    schema.setOrder(3500);
    schema.setDefaultPrivate(true);
    schema.setImplicitPrivateAuthority(true);
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE_PUBLIC, Lists.newArrayList("F_DASHBOARD_PUBLIC_ADD")));
    return schema;
}
Also used : Authority(org.hisp.dhis.security.Authority) Schema(org.hisp.dhis.schema.Schema)

Example 48 with Schema

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

the class MessageConversationSchemaDescriptor method getSchema.

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

Example 49 with Schema

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

the class MetadataVersionSchemaDescriptor method getSchema.

@Override
public Schema getSchema() {
    Schema schema = new Schema(MetadataVersion.class, SINGULAR, PLURAL);
    schema.setRelativeApiEndpoint(API_ENDPOINT);
    schema.getAuthorities().add(new Authority(AuthorityType.CREATE_PUBLIC, Lists.newArrayList("ALL", "F_METADATA_MANAGE")));
    return schema;
}
Also used : Authority(org.hisp.dhis.security.Authority) Schema(org.hisp.dhis.schema.Schema)

Example 50 with Schema

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

the class MinMaxDataElementSchemaDescriptor method getSchema.

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