spectramicro-role-management
v1.0.0
Published
```jsx import RoleManagement from "spectramicro-role-management";
Downloads
2
Readme
Usage
import RoleManagement from "spectramicro-role-management";
// Configuration
const config = {
baseUrl: "https://apigateway.mareana.com",
rolesTableInitialRequest: {
// To fetch roles using registered table
appId: "AUTHENTICATION",
resultsetId: "groups_roles_data",
filters: [],
metadata: true,
pageSize: 10,
},
rolesListInitialRequest: {
// To fetch roles using registered filter
appId: "AUTHENTICATION",
filterId: "roles_id_filter",
filters: [],
q: "",
},
appsInitialRequest: {
// To fetch users using registered apps
appId: "PRISM",
filterId: "app_filter",
filters: [],
q: "",
},
};
// Invoked on API request
const onRequest = () => {
console.log("onrequest");
};
// Invoked on API success
const onRequestSuccess = (data) => {
console.log("data", data);
};
// Invoked on API failure
const onRequestFailure = (err) => {
console.log("error", err);
};
// Usage
<RoleManagement
config={config}
onRequest={onRequest}
onRequestSuccess={onRequestSuccess}
onRequestFailure={onRequestFailure}
/>;