The following documents the user permission support in keystone based on the support being added via PR #2111. Permissions are based on roles. If a user has a role and the list also specifies that role for any of its CRUD operations then it is permissive for the user to perform whichever CRUD operation matches the role. All users must define, at least, one role. The following are guidelines for adding role/permission support to your application:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import useFriendStatus from './useFriendStatus'; | |
export default function FriendListItem(props) { | |
const isOnline = useFriendStatus(props.friend.id); | |
return ( | |
<li style={{ color: isOnline ? 'green' : 'black' }}> | |
{props.friend.name} | |
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Comments = ({ repoFullName }) => ( | |
<Mutation mutation={DELETE_COMMENT}> | |
{(deleteComment) => ( | |
<Query query={GET_CURRENT_USER}> | |
{({data: {currentUser}}) => ( | |
<Subscription | |
subscription={COMMENTS_SUBSCRIPTION} | |
variables={{ repoFullName }}> | |
{({ data: { commentAdded }, loading }) => ( | |
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function takes a component... | |
function withSubscription(WrappedComponent, selectData) { | |
// ...and returns another component... | |
return class extends React.Component { | |
constructor(props) { | |
super(props); | |
this.handleChange = this.handleChange.bind(this); | |
this.state = { | |
data: selectData(DataSource, props) | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
// numberBehaviour.js | |
const numberBehaviour = { | |
getInitialState() { | |
return { | |
newNumber: 1 | |
} | |
}, | |
setNewNumber(num) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState } from 'react'; | |
function Example() { | |
// Declare a new state variable, which we'll call "count" | |
const [count, setCount] = useState(0); | |
return ( | |
<div> | |
<p>You clicked {count} times</p> | |
<button onClick={() => setCount(count => count + 1)}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl s_client -crlf -connect imap.gmail.com:993 | |
tag login [email protected] passwordhere | |
tag list "" "*" | |
tag select "inbox" | |
tag fetch 1:3 body[header] | |
tag fetch 3 body[header] | |
tag fetch 3 body[text] | |
tag fetch 2 all | |
tag fetch 2 fast | |
tag fetch 2 full |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function () { | |
var BASE_PIXELS = 8; | |
var baselineNode = document.querySelector(".baseliner-overlay"); | |
if (baselineNode) { | |
baselineNode.remove(); | |
return; | |
} | |
var body = document.body, | |
html = document.documentElement, | |
height = Math.max(body.scrollHeight, body.offsetHeight, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ====================================== | |
// HIGHER ORDER CURRIED ARROW FUNCTIONS | |
// ====================================== | |
// Double arrows are great for creating functions | |
// that dont need all their arguments at once | |
// This is best for functions that need configuration | |
// before running on an active value. | |
// So here we have a function called |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import './App.css'; | |
const SORT_UP = 'up'; | |
const SORT_DOWN = 'down'; | |
function alphanumeric(a,b){ | |
if(a === b){ return 0; } | |
return a > b ? 1 : 0; | |
} |