Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2025, Aakvatech and contributors
// For license information, please see license.txt

frappe.ui.form.on('Temporary Role Access Grant Log', {
// refresh: function(frm) {

// }
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "TRAL-.YYYY.-.#####",
"creation": "2025-01-01 00:00:00.000000",
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"user",
"role",
"request",
"column_break_4",
"granted_on",
"revoked_on",
"was_existing_role",
"section_break_8",
"remarks"
],
"fields": [
{
"fieldname": "user",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "User",
"options": "User",
"reqd": 1,
"search_index": 1
},
{
"fieldname": "role",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Role",
"options": "Role",
"reqd": 1,
"search_index": 1
},
{
"fieldname": "request",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Request",
"options": "Temporary Role Access Request",
"reqd": 1,
"search_index": 1
},
{
"fieldname": "column_break_4",
"fieldtype": "Column Break"
},
{
"fieldname": "granted_on",
"fieldtype": "Datetime",
"in_list_view": 1,
"label": "Granted On",
"reqd": 1
},
{
"fieldname": "revoked_on",
"fieldtype": "Datetime",
"label": "Revoked On"
},
{
"default": "0",
"fieldname": "was_existing_role",
"fieldtype": "Check",
"label": "Was Existing Role"
},
{
"fieldname": "section_break_8",
"fieldtype": "Section Break"
},
{
"fieldname": "remarks",
"fieldtype": "Small Text",
"label": "Remarks"
}
],
"index_web_pages_for_search": 1,
"is_submittable": 0,
"links": [],
"modified": "2025-01-01 00:00:00.000000",
"modified_by": "Administrator",
"module": "Av Tools",
"name": "Temporary Role Access Grant Log",
"naming_rule": "Expression (old style)",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Role Access Approver",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1,
"track_seen": 0,
"track_views": 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) 2025, Aakvatech and contributors
# For license information, please see license.txt

import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import now_datetime, get_datetime, getdate


class TemporaryRoleAccessGrantLog(Document):
def validate(self):
"""Validate the grant log entry."""
if self.revoked_on and self.granted_on and get_datetime(self.revoked_on) < get_datetime(self.granted_on):
frappe.throw(_("Revoked On cannot be earlier than Granted On"))
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2025, Aakvatech and contributors
// For license information, please see license.txt

frappe.ui.form.on('Temporary Role Access Request', {
// refresh: function(frm) {

// }
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "TRA-.YYYY.-.#####",
"creation": "2025-01-01 00:00:00.000000",
"default_view": "List",
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"requested_for",
"requested_by",
"role_requested",
"column_break_4",
"from_datetime",
"to_datetime",
"duration_hours",
"section_break_8",
"reason",
"status",
"column_break_11",
"role_granted",
"granted_on",
"revoked_on",
"section_break_15",
"approver",
"approval_remarks",
"amended_from"
],
"fields": [
{
"fieldname": "requested_for",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Requested For",
"options": "User",
"reqd": 1,
"search_index": 1
},
{
"fetch_from": "requested_for.full_name",
"fieldname": "requested_for_name",
"fieldtype": "Read Only",
"in_list_view": 1,
"label": "Requested For (Name)",
"print_hide": 1
},
{
"fieldname": "requested_by",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Requested By",
"options": "User",
"reqd": 1,
"search_index": 1
},
{
"fieldname": "role_requested",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Role Requested",
"options": "Role",
"reqd": 1,
"search_index": 1
},
{
"fieldname": "column_break_4",
"fieldtype": "Column Break"
},
{
"fieldname": "from_datetime",
"fieldtype": "Datetime",
"in_list_view": 1,
"label": "From Date/Time",
"reqd": 1
},
{
"fieldname": "to_datetime",
"fieldtype": "Datetime",
"in_list_view": 1,
"label": "To Date/Time",
"reqd": 1
},
{
"fieldname": "duration_hours",
"fieldtype": "Float",
"label": "Duration (Hours)",
"read_only": 1
},
{
"fieldname": "section_break_8",
"fieldtype": "Section Break"
},
{
"fieldname": "reason",
"fieldtype": "Small Text",
"label": "Reason",
"reqd": 1
},
{
"fieldname": "status",
"fieldtype": "Select",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Status",
"no_copy": 1,
"options": "Draft\nPending Approval\nApproved\nRejected\nActive\nExpired\nCancelled",
"read_only": 1
},
{
"fieldname": "column_break_11",
"fieldtype": "Column Break"
},
{
"fieldname": "role_granted",
"fieldtype": "Check",
"label": "Role Granted",
"no_copy": 1,
"read_only": 1
},
{
"fieldname": "granted_on",
"fieldtype": "Datetime",
"label": "Granted On",
"no_copy": 1,
"read_only": 1
},
{
"fieldname": "revoked_on",
"fieldtype": "Datetime",
"label": "Revoked On",
"no_copy": 1,
"read_only": 1
},
{
"fieldname": "section_break_15",
"fieldtype": "Section Break"
},
{
"fieldname": "approver",
"fieldtype": "Link",
"label": "Approver",
"no_copy": 1,
"options": "User",
"read_only": 1
},
{
"fieldname": "approval_remarks",
"fieldtype": "Small Text",
"label": "Approval Remarks",
"no_copy": 1
},
{
"fieldname": "amended_from",
"fieldtype": "Link",
"label": "Amended From",
"no_copy": 1,
"options": "Temporary Role Access Request",
"print_hide": 1,
"read_only": 1,
"search_index": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"allow_attach": 1,
"links": [
{
"link_doctype": "Temporary Role Access Grant Log",
"link_fieldname": "request"
}
],
"modified": "2025-01-01 00:00:00.000000",
"modified_by": "Administrator",
"module": "Av Tools",
"name": "Temporary Role Access Request",
"naming_rule": "Expression (old style)",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"submit": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Role Access Approver",
"share": 1,
"submit": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "All",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1,
"track_seen": 1,
"track_views": 1
}
Loading
Loading