<commit_before><div 
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:p="http://primefaces.org/ui">
    <!-- Roles + Permissions Popup -->
    <p:dialog id="rolesPermissionsDialog" header="Roles + Permissions" widgetVar="rolesPermissionsForm" modal="true" styleClass="largePopUp"> 
        <p:fragment autoUpdate="true" rendered="#{rolePermissionFragment.dvObject!=null}">
            #{rolePermissionFragment.dvObject.displayName}         
            <p:commandLink id="ownerLink" rendered="#{!empty rolePermissionFragment.dvObject.owner and permissionServiceBean.on(rolePermissionFragment.dvObject.owner).has('AssignRole')}"
                           actionListener="#{rolePermissionFragment.setDvObject(rolePermissionFragment.dvObject.owner)}">
                <h:outputText value="(Up)" />
            </p:commandLink>
            <ui:fragment rendered="#{rolePermissionFragment.dvObject.instanceofDataverse and !empty rolePermissionFragment.dvObject.owner}">
                <div class="alert alert-danger form-horizontal" role="alert">
                    <div class="form-group" style="margin-bottom:0; padding-top:0;">
                        <label for="inputEmail3" class="col-sm-4 control-label" style="padding-top:0;">Inherit Roles + Permissions</label>
                        <div class="col-sm-8 checkbox" style="padding-top:0;min-height:20px;">
                            <h:selectBooleanCheckbox id="permissionRoot" value="#{rolePermissionFragment.inheritAssignments}">
                                <p:ajax listener="#{rolePermissionFragment.updatePermissionRoot}" />
                            </h:selectBooleanCheckbox>
                            <span style="vertical-align:top;">Inherit all roles and permissions from parent dataverse.</span>
                        </div>
                    </div>
                </div>
            </ui:fragment>    
            <p:tabView id="rolesPermissionsTabView" widgetVar="permissionsContent" styleClass="popupSubTabParent">
                <p:tab id="permissionsTab" title="Permissions">
                    <p:tabView id="permissionsSubTabView" widgetVar="subContent">
                        <p:tab id="usersGroupsSubTab" title="Users/Groups">
                            <ui:remove><!-- NOT YET IMPLEMENTED -->
                                <div class="highlight">
                                    <button type="button" class="btn btn-default" style="margin-right:1em;">Invite User</button> Invite a user to create a Dataverse account, and assign them a role to your dataverse.
                                </div>
                            </ui:remove>
                            <div class="highlight form-inline">
                                <div class="form-group">
                                    <label class="control-label">User/Group Name</label>
                                    <p:autoComplete id="userGroupNameAssign" styleClass="form-control" value="#{rolePermissionFragment.assignRoleUsername}" 
                                                    forceSelection="true" completeMethod="#{rolePermissionFragment.getIdentifiers}"/>
                                    <ui:fragment rendered="#{!rolePermissionFragment.dvObject.instanceofDataFile}">
                                        <label class="control-label">Role</label>
                                        <p:selectOneMenu id="assignRoleOptions" styleClass="form-control" value="#{rolePermissionFragment.assignRoleRoleId}">
                                            <f:selectItems value="#{rolePermissionFragment.availableRoles}" var="role" itemValue="#{role.id}"
                                                           itemLabel="#{role.name}  #{(role.owner eq null ? ' (global role)' : ' (defined in '.concat(role.owner.name).concat(' Dataverse)'))}"/>
                                        </p:selectOneMenu>
                                    </ui:fragment>                                    
                                    <p:commandLink styleClass="btn btn-default" 
                                                   value="#{rolePermissionFragment.dvObject.instanceofDataFile ? 'Grant Access' : 'Assign'}" 
                                                   actionListener="#{rolePermissionFragment.assignRole}"
                                                   style="color:black;margin-right:0.5em;"/>
                                    <ui:fragment rendered="#{rolePermissionFragment.dvObject.instanceofDataFile}">
                                        
                                        <p:commandLink styleClass="btn btn-default" 
                                                       value="#{permissionServiceBean.isDataFilePublic(rolePermissionFragment.dvObject) ? 'Restrict' : 'Make Public'}" 
                                                       actionListener="#{rolePermissionFragment.toggleFileRestrict}"
                                                       style="color:black;margin-right:0.5em;"/>
                                    </ui:fragment>                                                                        
                                </div>
                            </div>
                            <div>
                                <p:dataTable id="assignedRoles" var="roleAssignment" value="#{rolePermissionFragment.roleAssignments}">
                                    <p:column width="35%"  headerText="User / Group">
                                        <h:outputText value="#{roleAssignment.assigneeDisplayInfo.title} " />
                                    </p:column>
                                    <p:column width="15%"  headerText="Role" rendered="#{!rolePermissionFragment.dvObject.instanceofDataFile}">
                                        <h:outputText value="#{roleAssignment.roleName} " />
                                    </p:column>
                                    <p:column width="10%" headerText="Object" rendered="#{!rolePermissionFragment.dvObject.instanceofDataFile}">
                                        <h:outputText value="#{roleAssignment.assignedDvName}" />
                                    </p:column>
                                    <p:column width="40%" headerText="Action">
                                        <p:commandLink styleClass="btn btn-default" 
                                                       value="Revoke" 
                                                       action="#{rolePermissionFragment.revokeRole(roleAssignment.id)}"
                                                       rendered="#{permissionServiceBean.on(roleAssignment.definitionPoint).has('AssignRole')}"
                                                       update="assignedRoles"
                                                       style="color:black;margin-right:0.5em;"/>
                                    </p:column>
                                </p:dataTable>
                            </div>
                        </p:tab>
                        <p:tab id="dataversesSubTab" title="Dataverses" rendered="#{rolePermissionFragment.dvObject.instanceofDataverse}">
                            <p:dataTable id="dataverses" var="dv" value="#{dataverseServiceBean.findByOwnerId(rolePermissionFragment.dvObject.getId())}">
                                <p:column width="35%"  headerText="Dataverse">
                                    <h:outputText value="#{dv.name} " />
                                </p:column>
                                <p:column width="15%" headerText="Dataverse">
                                    <h:outputText value="#{dv.owner.name} " />
                                </p:column>
                                <p:column width="10%"  headerText="Publication Status">
                                    <h:outputText value="" />
                                </p:column>
                                <p:column width="40%" headerText="Action">
                                    <p:commandLink styleClass="btn btn-default" 
                                                   value="Edit" 
                                                   actionListener="#{rolePermissionFragment.setDvObject(dv)}"
                                                   rendered="#{permissionServiceBean.on(dv).has('AssignRole')}"
                                                   oncomplete="subContent.select(0);"                                                   
                                                   style="color:black;margin-right:0.5em;"/>
                                </p:column>
                            </p:dataTable>                        
                        </p:tab>
                        <p:tab id="datasetsSubTab" title="Datasets"  rendered="#{rolePermissionFragment.dvObject.instanceofDataverse}">
                            <p:dataTable id="datasets" var="ds" value="#{datasetServiceBean.findByOwnerId(rolePermissionFragment.dvObject.getId())}">
                                <p:column width="35%"  headerText="Dataset">
                                    <h:outputText value="#{ds.latestVersion.title} " />
                                </p:column>
                                <p:column width="15%"  headerText="Dataverse">
                                    <h:outputText value="#{ds.owner.name} " />
                                </p:column>
                                <p:column width="10%"  headerText="Publication Status">
                                    <h:outputText value="" />
                                </p:column>
                                <p:column width="40%" headerText="Action">
                                    <p:commandLink styleClass="btn btn-default" 
                                                   value="Edit" 
                                                   actionListener="#{rolePermissionFragment.setDvObject(ds)}"
                                                   rendered="#{permissionServiceBean.on(ds).has('AssignRole')}"
                                                   oncomplete="subContent.select(0);"
                                                   style="color:black;margin-right:0.5em;"/>
                                </p:column>
                            </p:dataTable>           
                        </p:tab>
                        <p:tab id="filesSubTab" title="Files" rendered="#{rolePermissionFragment.dvObject.instanceofDataset}">
                            <p:dataTable id="files" var="file" value="#{rolePermissionFragment.dvObject.asDataset.files}">
                                <p:column width="35%" sortBy="name" headerText="Dataset">
                                    <h:outputText value="#{file.fileMetadata.label} " />
                                </p:column>
                                <p:column width="10%"  headerText="Versions">
                                    <ui:repeat value="#{file.fileMetadatas}" var="fmd" varStatus="status">
                                        <h:outputText value="#{fmd.datasetVersion.semanticVersion}" />  
                                        <h:outputText value=", " rendered="#{!status.last}"/> 
                                    </ui:repeat>
                                </p:column>
                                <p:column width="35%" sortBy="name" headerText="Status">
                                    <h:outputText value="#{permissionServiceBean.isDataFilePublic(file) ? 'Public' : 'Restricted'}" />
                                </p:column>                                
                                <p:column width="40%" headerText="Action">
                                    <p:commandLink styleClass="btn btn-default" 
                                                   value="Edit" 
                                                   actionListener="#{rolePermissionFragment.setDvObject(file)}"
                                                   rendered="#{permissionServiceBean.on(file).has('AssignRole')}"
                                                   oncomplete="subContent.select(0);"
                                                   style="color:black;margin-right:0.5em;"/>
                                </p:column>
                            </p:dataTable>                             
                        </p:tab>
                    </p:tabView>
                </p:tab>
                <p:tab id="GroupsTab" title="Groups" rendered="#{rolePermissionFragment.dvObject.instanceofDataverse}">
                    <!-- FORM -->
                    Groups<commit_msg>add restricted as a property of DataFile<commit_after><div 
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:p="http://primefaces.org/ui">
    <!-- Roles + Permissions Popup -->
    <p:dialog id="rolesPermissionsDialog" header="Roles + Permissions" widgetVar="rolesPermissionsForm" modal="true" styleClass="largePopUp"> 
        <p:fragment autoUpdate="true" rendered="#{rolePermissionFragment.dvObject!=null}">
            #{rolePermissionFragment.dvObject.displayName}         
            <p:commandLink id="ownerLink" rendered="#{!empty rolePermissionFragment.dvObject.owner and permissionServiceBean.on(rolePermissionFragment.dvObject.owner).has('AssignRole')}"
                           actionListener="#{rolePermissionFragment.setDvObject(rolePermissionFragment.dvObject.owner)}">
                <h:outputText value="(Up)" />
            </p:commandLink>
            <ui:fragment rendered="#{!rolePermissionFragment.dvObject.instanceofDataFile and !empty rolePermissionFragment.dvObject.owner}">
                <div class="alert alert-danger form-horizontal" role="alert">
                    <div class="form-group" style="margin-bottom:0; padding-top:0;">
                        <label for="inputEmail3" class="col-sm-4 control-label" style="padding-top:0;">Inherit Roles + Permissions</label>
                        <div class="col-sm-8 checkbox" style="padding-top:0;min-height:20px;">
                            <h:selectBooleanCheckbox id="permissionRoot" value="#{rolePermissionFragment.inheritAssignments}">
                                <p:ajax listener="#{rolePermissionFragment.updatePermissionRoot}" />
                            </h:selectBooleanCheckbox>
                            <span style="vertical-align:top;">Inherit all roles and permissions from parent dataverse.</span>
                        </div>
                    </div>
                </div>
            </ui:fragment>    
            <p:tabView id="rolesPermissionsTabView" widgetVar="permissionsContent" styleClass="popupSubTabParent">
                <p:tab id="permissionsTab" title="Permissions">
                    <p:tabView id="permissionsSubTabView" widgetVar="subContent">
                        <p:tab id="usersGroupsSubTab" title="Users/Groups">
                            <ui:remove><!-- NOT YET IMPLEMENTED -->
                                <div class="highlight">
                                    <button type="button" class="btn btn-default" style="margin-right:1em;">Invite User</button> Invite a user to create a Dataverse account, and assign them a role to your dataverse.
                                </div>
                            </ui:remove>
                            <div class="highlight form-inline">
                                <div class="form-group">
                                    <label class="control-label">User/Group Name</label>
                                    <p:autoComplete id="userGroupNameAssign" styleClass="form-control" value="#{rolePermissionFragment.assignRoleUsername}" 
                                                    forceSelection="true" completeMethod="#{rolePermissionFragment.getIdentifiers}"/>
                                    <ui:fragment rendered="#{!rolePermissionFragment.dvObject.instanceofDataFile}">
                                        <label class="control-label">Role</label>
                                        <p:selectOneMenu id="assignRoleOptions" styleClass="form-control" value="#{rolePermissionFragment.assignRoleRoleId}">
                                            <f:selectItems value="#{rolePermissionFragment.availableRoles}" var="role" itemValue="#{role.id}"
                                                           itemLabel="#{role.name}  #{(role.owner eq null ? ' (global role)' : ' (defined in '.concat(role.owner.name).concat(' Dataverse)'))}"/>
                                        </p:selectOneMenu>
                                        <p:commandLink styleClass="btn btn-default" 
                                                       value="Assign" 
                                                       actionListener="#{rolePermissionFragment.assignRole}"
                                                       style="color:black;margin-right:0.5em;"/>
                                    </ui:fragment>                                    
                                    <ui:fragment rendered="#{rolePermissionFragment.dvObject.instanceofDataFile}">
                                        <p:commandLink styleClass="btn btn-default" 
                                                       value="Grant Access" 
                                                       actionListener="#{rolePermissionFragment.grantAccess}"
                                                       style="color:black;margin-right:0.5em;"/>                                        
                                        <p:commandLink styleClass="btn btn-default" 
                                                       value="#{rolePermissionFragment.dvObject.restricted ? 'Make Public' : 'Restrict'}" 
                                                       actionListener="#{rolePermissionFragment.toggleFileRestrict}"
                                                       style="color:black;margin-right:0.5em;"/>
                                    </ui:fragment>                                                                        
                                </div>
                            </div>
                            <div>
                                <p:dataTable id="assignedRoles" var="roleAssignment" value="#{rolePermissionFragment.roleAssignments}">
                                    <p:column width="35%"  headerText="User / Group">
                                        <h:outputText value="#{roleAssignment.assigneeDisplayInfo.title} " />
                                    </p:column>
                                    <p:column width="15%"  headerText="Role">
                                        <h:outputText value="#{roleAssignment.roleName} " />
                                    </p:column>
                                    <p:column width="10%" headerText="Object" rendered="#{!rolePermissionFragment.dvObject.instanceofDataFile}">
                                        <h:outputText value="#{roleAssignment.assignedDvName}" />
                                    </p:column>
                                    <p:column width="40%" headerText="Action">
                                        <p:commandLink styleClass="btn btn-default" 
                                                       value="Revoke" 
                                                       action="#{rolePermissionFragment.revokeRole(roleAssignment.id)}"
                                                       rendered="#{permissionServiceBean.on(roleAssignment.definitionPoint).has('AssignRole')}"
                                                       update="assignedRoles"
                                                       style="color:black;margin-right:0.5em;"/>
                                    </p:column>
                                </p:dataTable>
                            </div>
                        </p:tab>
                        <p:tab id="dataversesSubTab" title="Dataverses" rendered="#{rolePermissionFragment.dvObject.instanceofDataverse}">
                            <p:dataTable id="dataverses" var="dv" value="#{dataverseServiceBean.findByOwnerId(rolePermissionFragment.dvObject.getId())}">
                                <p:column width="35%"  headerText="Dataverse">
                                    <h:outputText value="#{dv.name} " />
                                </p:column>
                                <p:column width="15%" headerText="Dataverse">
                                    <h:outputText value="#{dv.owner.name} " />
                                </p:column>
                                <p:column width="10%"  headerText="Publication Status">
                                    <h:outputText value="" />
                                </p:column>
                                <p:column width="40%" headerText="Action">
                                    <p:commandLink styleClass="btn btn-default" 
                                                   value="Edit" 
                                                   actionListener="#{rolePermissionFragment.setDvObject(dv)}"
                                                   rendered="#{permissionServiceBean.on(dv).has('AssignRole')}"
                                                   oncomplete="subContent.select(0);"                                                   
                                                   style="color:black;margin-right:0.5em;"/>
                                </p:column>
                            </p:dataTable>                        
                        </p:tab>
                        <p:tab id="datasetsSubTab" title="Datasets"  rendered="#{rolePermissionFragment.dvObject.instanceofDataverse}">
                            <p:dataTable id="datasets" var="ds" value="#{datasetServiceBean.findByOwnerId(rolePermissionFragment.dvObject.getId())}">
                                <p:column width="35%"  headerText="Dataset">
                                    <h:outputText value="#{ds.latestVersion.title} " />
                                </p:column>
                                <p:column width="15%"  headerText="Dataverse">
                                    <h:outputText value="#{ds.owner.name} " />
                                </p:column>
                                <p:column width="10%"  headerText="Publication Status">
                                    <h:outputText value="" />
                                </p:column>
                                <p:column width="40%" headerText="Action">
                                    <p:commandLink styleClass="btn btn-default" 
                                                   value="Edit" 
                                                   actionListener="#{rolePermissionFragment.setDvObject(ds)}"
                                                   rendered="#{permissionServiceBean.on(ds).has('AssignRole')}"
                                                   oncomplete="subContent.select(0);"
                                                   style="color:black;margin-right:0.5em;"/>
                                </p:column>
                            </p:dataTable>           
                        </p:tab>
                        <p:tab id="filesSubTab" title="Files" rendered="#{rolePermissionFragment.dvObject.instanceofDataset}">
                            <p:dataTable id="files" var="file" value="#{rolePermissionFragment.dvObject.asDataset.files}">
                                <p:column width="35%" sortBy="name" headerText="Dataset">
                                    <h:outputText value="#{file.fileMetadata.label} " />
                                </p:column>
                                <p:column width="10%"  headerText="Versions">
                                    <ui:repeat value="#{file.fileMetadatas}" var="fmd" varStatus="status">
                                        <h:outputText value="#{fmd.datasetVersion.semanticVersion}" />  
                                        <h:outputText value=", " rendered="#{!status.last}"/> 
                                    </ui:repeat>
                                </p:column>
                                <p:column width="35%" sortBy="name" headerText="Status">
                                    <h:outputText value="#{file.restricted  ? 'Restricted' : 'Public'}" />
                                </p:column>                                
                                <p:column width="40%" headerText="Action">
                                    <p:commandLink styleClass="btn btn-default" 
                                                   value="Edit" 
                                                   actionListener="#{rolePermissionFragment.setDvObject(file)}"
                                                   rendered="#{permissionServiceBean.on(file).has('AssignRole')}"
                                                   oncomplete="subContent.select(0);"
                                                   style="color:black;margin-right:0.5em;"/>
                                </p:column>
                            </p:dataTable>                             
                        </p:tab>
                    </p:tabView>
                </p:tab>
                <p:tab id="GroupsTab" title="Groups" rendered="#{rolePermissionFragment.dvObject.instanceofDataverse}">
                    <!-- FORM -->
                    Groups
{'fraction_non_alphanumeric': 0.1111584162247939, 'fraction_numerical': 0.004489685334984712, 'mean_word_length': 1.1216948595828544, 'pattern_counts': {'":': 0, '<': 250, '<?xml version=': 0, '>': 250, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 215, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6074220', 'n_tokens_mistral': 5543, 'n_tokens_neox': 5281, 'n_words': 730}